Linux常用指令---定时任务

linux定时任务
crontab命令选项基本只有对用户操作选项:
-u 指定用户
-l 列出某用户任务计划
-r 删除某用户任务
-e 编辑某用户任务

 

查看某一用户的定时任务crontab -u root -l


所要查看所有用户只能根据/etc/passwd文件用户名枚举了用脚本
用户定时任务/var/spool/cron/里, 作root去看:
cd /var/spool/cron
cat *

eg:如下

12:15,12:30分时将两种文件先生成在238.213这台机器上,在12:45分时将其同步到239.57这台机器

238.21315 0 * * * /usr/bin/wget -O /dev/null --spider -t 1 -T 30 'http://192.168.238.213:8080/template/ladyproduct/intf/intf4ZhongSou.jsp?status=1&cId=1393' >/dev/null 2>&1
30 0 * * * /usr/bin/wget -O /dev/null --spider -t 1 -T 30 'http://192.168.238.213:8080/template/ladyproduct/intf/intf4ZhongSou.jsp?status=-1&cId=1393' >/dev/null 2>&1

45 0 * * * rsync
238.213:/data/web/pclady-photo/dataxml/data_normal_*.xml  -->239.57
238.213:/data/web/pclady-photo/dataxml/data_forbidden_*.xml -->239.57

linux下定时执行任务的方法

Linux定时任务设置

【linux】/dev/null与/dev/zero详解

 

每天一个linux命令(50):crontab命令

posted @ 2014-09-01 22:41  ^_TONY_^  阅读(558)  评论(0编辑  收藏  举报