LINUX下使用crontab进行RMAN备份实验(二)
n-parts /etc/cron.hourly)
Jul 4 17:02:50 oel-01 crontab[28313]: (oracle) BEGIN EDIT (oracle)
Jul 4 17:02:54 oel-01 crontab[28315]: (oracle) BEGIN EDIT (oracle)
Jul 4 17:02:58 oel-01 crontab[28317]: (oracle) BEGIN EDIT (oracle)
Jul 4 17:03:11 oel-01 crontab[28317]: (oracle) REPLACE (oracle)
Jul 4 17:03:11 oel-01 crontab[28317]: (oracle) END EDIT (oracle)
Jul 4 17:03:27 oel-01 crontab[28321]: (oracle) LIST (oracle)
Jul 4 17:04:01 oel-01 crond[27777]: (oracle) RELOAD (cron/oracle)
Jul 4 17:05:21 oel-01 crond[28396]: (CRON) STARTUP (V5.0)
Jul 4 17:05:21 oel-01 crond[28396]: (CRON) @reboot jobs will be run at computer's startup. ()
五、关于cron定时命令
cron
/etc/cron.allow /etc/cron.deny 使用与at相同
-u 只有ROOT才能进行这个任务
-e 编辑crontab的工作内容,主要针对使用者的cron设计
-l 查阅crontab的工作内容
-r 移除所有crontab工作内容,
代表意义 分钟 小时 日期 月 周 指令
数字范围 0-59 0-23 1-31 1-12 0-7 指令
*代表任何时刻 0 12 * * * ls /root 每一天的12点整开始执行
,代表分隔时段0 3,6 * * * ls 不写是3点还是6点都执行
-代表一段时间范围内 20 8-12 * * * ls 8 9 10 12 12点的20分都执行
/n 代表数字,是第N个间隔 */5 * * * * ls 每五分钟执行一次,也可以写成0-59/5
每个crontab都只有一个档案存在,在/var/spool/cron里,指令下达最好用绝对路径
注意事项
资源分配不均的问题 比如同时进行多个耗费系统资源的命令时,注意将其分开,
取消不需要的输出 /dev/null
周与日不可同时并存
出现非自己设定的cron 注意
系统安全了。