ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: therion <therion@pochta.ru>
To: community@altlinux.ru
Subject: Re: [Comm] Cron reboot
Date: Thu, 6 Nov 2003 09:36:06 +0500
Message-ID: <200311060936.06454.therion@pochta.ru> (raw)
In-Reply-To: <1225621867.20031105190222@amos.ru>

В сообщении от 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 не перезагружаются годами).
Желаю удачи.

  reply	other threads:[~2003-11-06  4:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-05 16:02 Ivanov Maxim
2003-11-06  4:36 ` therion [this message]
2003-11-06  4:54 ` Mike Lykov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200311060936.06454.therion@pochta.ru \
    --to=therion@pochta.ru \
    --cc=community@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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