Very often, on Linux-like systems, some routine processes may need to be automated. For this, special planners are used. One of the most famous of them is Cron, the settings of which will be discussed in this article.
What is a cron?
The name of the program is derived from the Greek "chronos", meaning time. Which, in fact, is logical. The task of the demon is to execute commands recorded in it at certain moments. The implementation process itself is based on checking the crown tables and comparing them with the current date and time.
Crontab file
Cron crontab. . . /etc/cron.d, .
crontab.
Linux . RedHat — var/spool/cron. Debian Ubuntu var/spool/cron/crontabs. var/spool/cron/tabs SUSE.
crontab
Cron , . crontab. :
- -u _. , . , .
- -l. .
- -e. .
- -r. .
, Cron . , :
- . — 0 59. , ;
- — . 0 23;
- — . 1 31;
- — . 1, — 12;
- — . 0 7 ;
- .
, , «*» «/». , — 23 */2 *** echo «» , 23 «».
crontab
Cron , , :
Cron . , :
- sun — ;
- mon — ;
- tue — ;
- wed — ;
- thu — ;
- fri — ;
- sat — .
— jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec.
Cron , :
- @reboot. ;
- @yearly. . : 0 0 1 1 *. @annually;
- @monthly. , . — 0 0 1 * *;
- @weekly. ;
- @dayly. ;
- @midnight. ;
- @hourly. .
Cron Centos 7
Linux . Cron Centos cronie . yum install cronie. crontab -e. Cron /var/spool/cron/ .
Cron , .
- 00 09-17 * * 1 - 5 // / . 9 5 ;
- 00 9,17 * * * // / . . 9, - 5 . «*» , , ;
- . , @monthly . @daily .
Cron
, Cron . «» . .
Cron , . .
. , , . , .
. . , , Debian, gnome schedule. KDE kcron.
, Cron . , , Cron , .
, , Windows NnCron. — Task Scheduler. Microsoft. — schtasks.exe.