-
-
Save wxianfeng/2379012 to your computer and use it in GitHub Desktop.
crontab DEMO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# edit crontab job | |
>crontab -e | |
[root@localhost shell]# crontab -l | |
# m h d mon dow command | |
0 3 * * * root /bin/sh /data/shell/scan_yuezhi.sh >> /data/shell/output.txt 2>&1 # 每天早晨3点执行 | |
* * * * * root /bin/sh /data/shell/date.sh >> /data/shell/output.txt 2>&1 # 每分钟一次 | |
# scan_yuezhi.sh | |
#!/bin/sh | |
cd /data/projects/project_manager/ | |
/usr/bin/rake pm:scan_tasks RAILS_ENV=production | |
# date.sh | |
#!/bin/sh | |
/bin/date >> /tmp/date.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment