[crontab] 在bash中加载cron环境以进行debug

自动加载crontab的运行env,并在bash中加载crontab的环境,对script进行测试
http://stackoverflow.com/questions/2135478/how-to-simulate-the-environment-cron-executes-a-script-with
Add this to your cron:
30 08 * * * env > ~/cronenv
After it runs, do this:
env - `cat ~/cronenv` /bin/sh
 
在cron中加载rvm环境
http://rvm.io/integration/cron
 
查看cron运行的情况
sudo tail /var/log/cron 

猜你喜欢

转载自iandaicsu.iteye.com/blog/1943903