Home  >  Article  >  Database  >  Ubuntu 11.04中 Oracle定时备份

Ubuntu 11.04中 Oracle定时备份

WBOY
WBOYOriginal
2016-06-07 17:02:35840browse

cron服务每分钟不仅要读一次/var/spool/cron内的所有文件,还需要读一次/etc/crontab,因此我们配置这个文件也能运用 cron服务做一

Ubuntu中

编辑文件 /etc/crontab

sudo vi  /etc/crontab

cron服务每分钟不仅要读一次/var/spool/cron内的所有文件,还需要读一次/etc/crontab,因此我们配置这个文件也能运用 cron服务做一些事情。用crontab配置是针对某个用户的,而编辑/etc/crontab是针对系统的任务。此文件的文件格式是:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin=
MAILTO=root      //如果出现错误,或者有数据输出,数据作为邮件发给这个帐号
HOME=/    //使用者运行的路径,这里是根目录
# run-parts
01 * * * * root run-parts /etc/cron.hourly      //  每小时 以root用户身份 执行/etc/cron.hourly内的脚本
02 4 * * * root run-parts /etc/cron.daily        //  每天 以root用户身份 执行/etc/cron.daily内的脚本
22 4 * * 0 root run-parts /etc/cron.weekly   //   每星期  以root用户身份 执行/etc/cron.weekly内的脚本
42 4 1 * * root run-parts /etc/cron.monthly //   每月   以root用户身份 去执行/etc/cron.monthly内的脚本

注意"run-parts"这个参数,如果去掉这个参数的话,后面就可以写要运行的某个脚本名,而不是文件夹名了。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn