Линуксоид-стакановец
Сообщения: 2391
Благодарности: 186
|
Профиль
|
Отправить PM
| Цитировать
hasherfrog, в файле /etc/crontab:
Цитата:
22.1.2 The cron Package
If you want to run commands regularly and automatically in the background at predefined times, cron is the traditional tool to use. cron is driven by specially formatted time tables. Some of of them come with the system and users can write their own tables if needed.
The cron tables are located in /var/spool/cron/tabs. /etc/crontab serves as a systemwide cron table. Enter the username to run the command directly after the time table and before the command. In Example 22-1, root is entered. Package-specific tables, located in /etc/cron.d, have the same format. See the cron man page (man cron).
Example 22-1 Entry in /etc/crontab
1-59/5 * * * * root test -x /usr/sbin/atrun && /usr/sbin/atrun
You cannot edit /etc/crontab by calling the command crontab -e. This file must be loaded directly into an editor, modified, then saved.
A number of packages install shell scripts to the directories /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly, whose execution is controlled by /usr/lib/cron/run-crons. /usr/lib/cron/run-crons is run every 15 minutes from the main table (/etc/crontab). This guarantees that processes that may have been neglected can be run at the proper time.
To run the hourly, daily, or other periodic maintenance scipts at custom times, remove the time stamp files regulary using /etc/crontab entries (see Example 22-2, which removes the hourly one before every full hour, the daily one once a day at 2:14 a.m., etc.).
Example 22-2 /etc/crontab: Remove Time Stamp Files
59 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly
14 2 * * * root rm -f /var/spool/cron/lastrun/cron.daily
29 2 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly
44 2 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly
The daily system maintenance jobs have been distributed to various scripts for reasons of clarity. They are contained in the package aaa_base. /etc/cron.daily contains, for example, the components suse.de-backup-rpmdb, suse.de-clean-tmp, or suse.de-cron-local.
|
Взято тут
|
-------
Живя в реальном мире, стремись к невероятному... Эрнесто Че Гевара
Everybody lies. (c) House M.D.
Базовая настройка Ubuntu. Документация для новичка.
Руководство по установке, начальной настройке и основам использования операционной системы Ubuntu
Отправлено: 13:37, 15-07-2008
| #2
|