cron 使用笔记
2013-12-30 19:18
197 查看
重定向输出
/usr/bin/perl /home/joe/netcheck.pl 1>/home/joe/netcheck-stdout.log 2>/home/joe/netcheck-stderr.log &
http://superuser.com/questions/45874/perlscript-runs-fine-when-executed-manually-but-not-under-cron
crontab 相对路径
切换到相应目录
cd $(dirname $0)
http://blog.enkitec.com/2011/05/make-bash-scripts-crontab-compatible/
http://stackoverflow.com/questions/8899737/crontab-run-in-directory
https://kb.mediatemple.net/questions/1588/Troubleshooting+common+issues+with+cron+jobs#gs
使用crontab 运行sh脚本,然后sh运行程序出现:root: command not found
解决方法:
this begins happening from running sudo crontab /etc/crontab, it then makes a cron file for root in /var/spool/cron/crontabs.
run rm /var/spool/cron/crontabs/root and it is fixed.
http://ubuntuforums.org/archive/index.php/t-1035016.html
参考:
https://kb.mediatemple.net/questions/1588/Troubleshooting+common+issues+with+cron+jobs#gs
/usr/bin/perl /home/joe/netcheck.pl 1>/home/joe/netcheck-stdout.log 2>/home/joe/netcheck-stderr.log &
http://superuser.com/questions/45874/perlscript-runs-fine-when-executed-manually-but-not-under-cron
crontab 相对路径
切换到相应目录
cd $(dirname $0)
http://blog.enkitec.com/2011/05/make-bash-scripts-crontab-compatible/
http://stackoverflow.com/questions/8899737/crontab-run-in-directory
https://kb.mediatemple.net/questions/1588/Troubleshooting+common+issues+with+cron+jobs#gs
使用crontab 运行sh脚本,然后sh运行程序出现:root: command not found
解决方法:
this begins happening from running sudo crontab /etc/crontab, it then makes a cron file for root in /var/spool/cron/crontabs.
run rm /var/spool/cron/crontabs/root and it is fixed.
http://ubuntuforums.org/archive/index.php/t-1035016.html
参考:
https://kb.mediatemple.net/questions/1588/Troubleshooting+common+issues+with+cron+jobs#gs
相关文章推荐
- 学习笔记:UINavigationController使用详解
- android shape使用笔记
- Volley框架使用笔记
- 【DEBUG笔记】VTK中使用std::vector时报指针错误“读取位置xxx时发生访问冲突”
- 黑马程序员——Java基础——IO流笔记(InputStreamReader和OutputStreamWriter使用示例)
- Android Studio 使用笔记:工具窗口浮动与布局恢复
- Linux使用笔记
- 黑马程序员——Java基础——IO流笔记(PipedInputStream和PipedOutputStream使用示例)
- pyWavelet 小波工具箱的使用笔记
- iOS YYText的使用笔记二(YYLabel聊天表情+文字并排)
- Python语言opencv使用笔记(七)(图像梯度与边缘检测)
- C#笔记 使用自定义事件(含参)
- Ubuntu使用笔记_root登录
- hadoop使用lzo压缩文件笔记 (cdh3u0)
- python学习笔记之使用threading模块实现多线程(转)
- Wireshark使用笔记
- MySQL笔记之索引的使用
- 使用笔记--教大家搭建一个个人博客
- Quick cocos2dx-Lua(V3.3R1)学习笔记(十二)----使用Cocos Code IDE 配合自带的PrebuiltRuntimeLua.apk进行真机调试
- DWZ使用笔记