EnServe Administrators Manual
contents
Managing Automation

Overview

Cron is a very versatile utility for scheduling work, it is a 'daemon'. This is a program that runs all the time on a Unix machine, without any intervention from the user, and schedules specified programs to run at specific times.

Changing / Adding Scheduled Jobs

You configure cron using the admin login. From this menu select:

  • Administrative Menu
  • Edit System Files
  • Crontab

Note: As cron lines can exceed one screen width we cannot use the basic ste editor - this option uses the Vi editor which is a little more complicated - See Using vi for more details.

There are six sections to a cron entry e.g. 12 3 * * * Command

     
    12     3      *         *         *         Command
    ^      ^      ^         ^         ^            ^
    |      |       |        |         |            |
    Mins Hours  Day of    Month of  Day of      Command to  
                month      year      week         run
    

The * means any valid time/date, so this sample command will run at 3.12am every day of the week. Some examples:
12 18-06 * * * Command Runs at 12 mins past the hour, between 6pm and 6 am the next day.
12 3 * * * 1-5 Command Runs once a day (3:12am) Mon - Fri

Note: Sunday is 0, Monday 1, Tuesday 2 etc.

Some Uses

Keeping the Server System Time correct

    You have the option on the Admin Menu (Option e -> i -> Web) to sync the time on-demand but why don't you add it to cron so it runs automatically?

    0,30 * * * * /etc/ntpdate ntp.demon.co.uk >/dev/null

    This will update the date and time every 30 mins.

Updating Virus Definition Files

    You have the option on the Admin Menu (Option f -> Virus) to update the definition files on-demand but why don't you add it to cron so it runs automatically?

    15 5 * * * /usr/utilities/update_uvscan

    This will update daily at 5:15am.

Some of the exisiting EnServe Related settings

    0 6 * * 0 /usr/utilities/sec | mail -s "Security Report" security
    20 1 * * 0 /usr/local/bin/uvscan -rp --ignore-links --summary  -f /etc/default/uvscan | mail -s "Weekly Virus Check" security >/dev/null 2>&1
    10 0 * * 1-6 /usr/local/bin/uvscan -rp --ignore-links --summary -f /etc/default/uvscan-daily | mail -s "Daily Scan" security > /dev/null 2>&1
    

Here at 6:00am on Sundays (0) a security report will be mailed to the user security (actually an alias). At 1:20am on Sundays the system will scan the whole system for Virus. At 0:10am Monday to Saturday it will scan just the users home directories.


contents