crontab - auto execute schedule on unix/linux
2010-07-04 15:59
295 查看
Two usefull command:
crontab -l # list all the crontab task exist
crontab -e # edit this crontab schedule
#(default editor is vi if you want to change modify the VISUAL env variable using comman setenv)
Crontab format : reference from wikepedia
.---------------- minute (0 - 59)
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12) OR jan,feb,mar,apr ...
| | | | .----- day of week (0 - 7) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * command to be executed
Examples : execute my backup.sh every day at 2' aclock
0 2 * * * /home/oracle/bin/backup.sh
More examples of format:
#every 5 minutes
*/5 * * * * command to be executed
#from 6 to 12 aclock every 20 minutes
0 6-12/3 * * * command to be execute
#first day every month and monday to friday at 8 and 18 aclock
0 8,18 1 * mon-fri command to be execute
One tip you can use the way followed to edit your contab schedule:
crontab -l>tmp
vi tmp
crontab tmp
crontab -l # list all the crontab task exist
crontab -e # edit this crontab schedule
#(default editor is vi if you want to change modify the VISUAL env variable using comman setenv)
Crontab format : reference from wikepedia
.---------------- minute (0 - 59)
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12) OR jan,feb,mar,apr ...
| | | | .----- day of week (0 - 7) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * command to be executed
Examples : execute my backup.sh every day at 2' aclock
0 2 * * * /home/oracle/bin/backup.sh
More examples of format:
#every 5 minutes
*/5 * * * * command to be executed
#from 6 to 12 aclock every 20 minutes
0 6-12/3 * * * command to be execute
#first day every month and monday to friday at 8 and 18 aclock
0 8,18 1 * mon-fri command to be execute
One tip you can use the way followed to edit your contab schedule:
crontab -l>tmp
vi tmp
crontab tmp
相关文章推荐
- Schedule tasks on Linux using crontab
- Schedule tasks on Linux using crontab 2
- Schedule tasks on Linux using crontab
- Schedule tasks on Linux using crontab 3
- Schedule Tasks on Linux Using Crontab
- Auto start your service application on Linux boot
- [Solved] [ARM Linux] [Qt] $./hello -qws Not Success on ARM Linux: lack of unix module support
- ORA-12012: error on auto execute of job "ORACLE_OCM"."MGMT_CONFIG_JOB_2_1"
- linux Centos下搭建性能监控Spotlight on Unix
- Three Common Problems during Domino Setup and Start on Linux/Unix
- linux/unix/centos下直接执行脚本可以成功,但是放在crontab里面就不行~解释如下
- ORA-12012: error on auto execute of job;PLS-00306: wrong number or types ofarguments in call to
- Unix/Linux 下如果手动执行脚本可以正常运行,而放在crontab里面就有问题的话
- ORA-12012: error on auto execute of job "SYS"."BSLN_MAINTAIN_STATS_JOB" ORA-01950: no privileges on
- ORA-12012: error on auto execute of job "ORACLE_OCM
- DB2 SQL PL : Essential Guide for DB2 UDB on Linux, UNIX, Windows, i5/OS, and z/OS, Second Edition
- Creating a broker on Linux and UNIX systems
- Linux监控工具Spotlight on Unix
- 详解Unix/Linux中周期执行指令Crontab命令
- ORA-12012: error on auto execute of job "ORACLE_OCM"."MGMT_CONFIG_JOB_2_3"