* [Comm] Cron reboot
@ 2003-11-05 16:02 Ivanov Maxim
2003-11-06 4:36 ` therion
2003-11-06 4:54 ` Mike Lykov
0 siblings, 2 replies; 3+ messages in thread
From: Ivanov Maxim @ 2003-11-05 16:02 UTC (permalink / raw)
To: community
Здравствуйте, community.
Подскажите пожалуйста, как правильно написать команду в
/etc/crontab/
для перезагрузки сервера (reboot) каждые два дня.
--
С уважением,
Ivanov
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Comm] Cron reboot
2003-11-05 16:02 [Comm] Cron reboot Ivanov Maxim
@ 2003-11-06 4:36 ` therion
2003-11-06 4:54 ` Mike Lykov
1 sibling, 0 replies; 3+ messages in thread
From: therion @ 2003-11-06 4:36 UTC (permalink / raw)
To: community
В сообщении от 5 Ноябрь 2003 21:02 Ivanov Maxim написал(a):
> Здравствуйте, community.
>
> Подскажите пожалуйста, как правильно написать команду в
> /etc/crontab/
> для перезагрузки сервера (reboot) каждые два дня.
В каталоге /var/spool/cron (вообще можно, конечно в любом другом, неважно) создайте файлик root, напишите в нем примерно следующее
0 6 * * 1,4,7 reboot
Это значит, что перезагрузка будет происходить в 6 часов 0 минут по утрам. Независимо от текушего месяца (вторая звездочка) и текущей даты (первая звездочка) по первым (понедельник) четвертым (четверг) и седьмым (воскресенье) дням недели далее следует непосредственно сама команда.
После того как файл будет отредактирован следует от имени суперпользователя запустить команды обновления задания
crontab -u root /var/spool/cron/root
Вот в принципе и все.
Тоже самое можно проделать (при условии что вы знакомы с редактором vi) при помощи самой утилиты crontab (в этом случае обновления задания произойдет автоматически)
для этого надо набрать в командной строке следующее
crontab -u root -e
Можно нескромный вопрос? А для чего необходимо перезагружать сервер каждые два дня. Вероятно проблему можно решить по другому (у нас сервера на Linux не перезагружаются годами).
Желаю удачи.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Comm] Cron reboot
2003-11-05 16:02 [Comm] Cron reboot Ivanov Maxim
2003-11-06 4:36 ` therion
@ 2003-11-06 4:54 ` Mike Lykov
1 sibling, 0 replies; 3+ messages in thread
From: Mike Lykov @ 2003-11-06 4:54 UTC (permalink / raw)
To: community
В сообщении от Среда 05 Ноябрь 2003 20:02 Ivanov Maxim написал:
> Подскажите пожалуйста, как правильно написать команду в
> /etc/crontab/
> для перезагрузки сервера (reboot) каждые два дня.
а зочем?????????? ;)))))))))))
man crontab
crontab -e (потом :wq)
использовать shutdown -r ;)
--
Mike
registered linux user #315334
jabber id: combr@jabber.ru
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-11-06 4:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-05 16:02 [Comm] Cron reboot Ivanov Maxim
2003-11-06 4:36 ` therion
2003-11-06 4:54 ` Mike Lykov
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git