- 论坛徽章:
- 0
|
crontab怎样每隔5分钟执行一次脚本?
To schedule /appl/program to run every five minutes,you can either use the crontab command or the at command.
crontab:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /appl/program
Alternatively ,you can use the at command.For scheduling the /apl/program to run every five minutes,or some short intervals repeatedly,modify the /appl/program file by adding the at command as follows:
#!/usr/bin/ksh
at now + 5 minutes -f /appl/program >; /dev/null 2>;&1
print program executed at `date +%H:%M`>;>; /data/output
Start the first job with the command:
at now -f appl/program >; /dev/null 2>;&1
Understand??????????? |
|