[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: periodic jobs like FreeBSD

Quoting David Bear <David Bear asu edu>:

Does redhat support something close to the period scripts that FreeBSD
has? The script I am interested in are the daily, weekly and monthly
reports that include output from disk usage (df -h), and lastlog.

The logwatch package will produce daily report with stuff you want (and more) and mail it out (to root). You can invoke it from command line with different time span, and also have it either use only current log files, or both current files and archived files.

If you want something more specific, general guideline is, use cron to schedule periodic jobs. That's what it is for. I guess "periodic scripts from FreeBSD" you mentioned are started by cron daemon too.

You've several options.

You can write your own scripts and place them under /etc/cron.hourly, cron.daily (runs @ 4:02), cron.weekly (runs @ 4:22) and cron.monthly (runs at 4:42) directories. Those normally are started as root user. For example, logwatch will install its script into cron.daily.

You can add jobs into /etc/crontab to be run at whatever time and time intervals you choose (stuff for cron.* directories is called from there). They'll run as specified user.

You can add cronjobs to any user's personal cronjob file using crontab command. Don't forget to check content of /etc/cron.allow and cron.deny files to see if user is allowed to have personal cron jobs. Those jobs will run as user they belong to, at whatever time interval and time you choose.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]