Read Time:42 Second
Reference URL
http://www.k4.dion.ne.jp/~mms/unix/linux_com/crontab.html
http://www.k4.dion.ne.jp
Edit
crontab [-u user] -e
View
crontab [-u user] -l
Format
Minute Hour Day Month Day of Week Command
┌────────── minute (0 - 59)
│ ┌──────── hour (0 - 23)
│ │ ┌────── day of month (1 - 31)
│ │ │ ┌──── month (1 - 12)
│ │ │ │ ┌── day of week (0 - 6 => Sunday - Saturday, or
│ │ │ │ │ 1 - 7 => Monday - Sunday)
↓ ↓ ↓ ↓ ↓
* * * * * command to be executed
How to write Day of Week
The Day of the Week syntax is depicted in the table shown below. (*) indicates every day of week.
0 sun
1 mon
2 tue
3 wed
4 thu
5 fri
6 sat
Sample:
*/5 * * * 5 /usr/bin/python test.py > /tmp/test.log 2>&1