|
Fedora LinuxBy default, any output (to stdout or stderr ) produced by a scheduled command will be emailed to you. You can change the email destination by including a line that sets the MAILTO environment variable: MAILTO=cronman@gmail.com 30 * * * * /home/chris/bin/task1 15 1 * * * /home/chris/bin/task2 0 22 * * 1 /home/chris/bin/task3 In fact, you can also set any standard environment variables; the two most useful are SHELL , which overrides the default shell ( bash ), and PATH , which overrides the default path ( /bin:/usr/bin ). Here's an example: PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin SHELL=/bin/zsh MAILTO="" 30 * * * * adjust-network Fedora also provides a system for running scripts on an hourly, daily, weekly, and monthly basis, simply by placing the script into a designated directory. These scripts run as root . Table 6-8 shows the time of execution for each directory. Table 6-8. Scheduled task directories Directory Frequency Time of execution Task examples /etc/cron.hourly Hourly :01 past each hour Send/receive netnews /etc/cron.daily Daily 4:02 a.m. every day Analyze web logs, rotate logs, delete old temporary files, monitor cryptographic certificate expiry, update installed software /etc/cron.weekly Weekly 4:22 a.m. every Sunday Clean up old yum packages, index manpages /etc/cron.monthly Monthly 4:42 a.m. on the first day of every month (None defined) Many Fedora packages install files into these directories to schedule tasks; for example, the webalizer package installs /etc/cron.daily/00webalizer to set up automatic web log analysis ...» |
Код для вставки книги в блог HTML
phpBB
текст
|
|