cron & crontab Flashcards
How to check crontab for all users on server?
?
How to edit your own crontab?
crontab -e
Edit root crontab?
sudo crontab -e
Crontab sections?
minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command
like in ‘01 04 1 1 1 /usr/bin/somedirectory/somecommand’ (which will run at 4:01am on January 1st plus every Monday in January)
What is asterisk symbol meaning in crontab?
Every instance of given time period will be used. Say, first * means that a script will run every minute, etc.
What are comma-separated values in crontab sections?
Означают, что событие должно происходить несколько раз за определенный период времени. Например, 01,31 в минутах означает, что команда будет запускаться в 1 и 31 минуту (указанного дальше периода времени)
What are divisors (/) in crontab sections?
Run a script some number of times per time unit. For example if you want to run it every 10 minutes use the following crontab entry (runs on minutes divisible by 10: 0, 10, 20, 30, etc.): */10 etc.
(equiv. to 0,10,20,30,40,50 etc.)
What option is to show current crontab to stdout?
crontab -l
What option removes current crontab?
crontab -r
What editor will be used when editing current crontab via crontab -e?
Specified in $EDITOR env var.