Linux定时任务 - atd和crond
2013-02-14 20:45
281 查看
d在结尾处一般表示服务
crond一般用的比较多
打开/etc 找到cron开头的文件和文件夹
这些脚本每天都执行
hourly每小时执行,monthly每月,weekly每周
通过这种方式创建周期性执行脚本
* * * * * 表示
分时日月周
crontab -e 创建定时任务
例如,每分钟执行一个命令
* * * * * "this will run every minute"
crontab -l 查看当前用户定时任务
详情请见man
crond一般用的比较多
打开/etc 找到cron开头的文件和文件夹
root@iwissen:/etc# ls -ld cron* drwxr-xr-x 2 root root 4096 Feb 7 18:03 cron.d drwxr-xr-x 2 root root 4096 Aug 21 23:58 cron.daily drwxr-xr-x 2 root root 4096 Aug 21 23:56 cron.hourly drwxr-xr-x 2 root root 4096 Aug 21 23:56 cron.monthly drwxr-xr-x 2 root root 4096 Aug 21 23:58 cron.weekly -rw-r--r-- 1 root root 718 Feb 7 18:03 crontab打开cron.daily文件夹,看看里面有什么
root@iwissen:/etc# cd cron.daily/ root@iwissen:/etc/cron.daily# ll total 16 drwxr-xr-x 2 root root 4096 Aug 21 23:58 ./ drwxr-xr-x 84 root root 4096 Feb 9 05:56 ../ -rwxr-xr-x 1 root root 372 Oct 5 2011 logrotate* -rwxr-xr-x 1 root root 1309 Oct 26 2010 sysklogd*很多都是脚本
这些脚本每天都执行
hourly每小时执行,monthly每月,weekly每周
通过这种方式创建周期性执行脚本
# /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 43 * * * * root cd / && run-parts --report /etc/cron.hourly 3 5 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 29 5 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 20 3 7 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
* * * * * 表示
分时日月周
crontab -e 创建定时任务
例如,每分钟执行一个命令
* * * * * "this will run every minute"
crontab -l 查看当前用户定时任务
详情请见man
相关文章推荐
- Linux定时任务-crond
- linux 定时任务 crond 服务应用指南(项目实例)
- linux定时任务crond服务详细说明
- linux的定时任务crond(crontab)服务
- linux crond定时任务源码分析
- Linux命令之crond周期定时计划任务执行
- Linux下利用Crond和Expect定时登陆交换机执行任务
- Linux定时任务:crond和crontab详解
- Linux crond定时任务服务
- linux crond定时任务详细介绍
- 关于linux的crond定时任务的一些常见问题
- Linux定时任务之crond/crontab
- Linux的crond定时任务
- linux下使用crond定时执行kettle的job任务
- 关于linux的crond定时任务的一些常见问题
- linux 秒级别定时任务 crond shell while
- Linux -- Crond 定时任务
- linux的定时任务服务crond(crontab)服务
- 调研crond (linux下的定时任务)
- Linux之————守护进程与crond定时任务 推荐