Chapter 10. Scheduled tasks

Table of Contents

10.1. Testing the crontab
10.2. System scheduled tasks

Jobs can be scheduled to run on a per-domain basis. This is configured in the same style as the traditional crontab, and is kept in the config/ directory of a domain.

10.1. Testing the crontab

The crontab can also be tested. To do this you have to SSH to the machine, usually as admin to run the command.

For example, to test the crontab navigate to /srv/ and run symbiosis-crontab --test crontab.

The crontab reads

# Send any output to Bob

# run at 18:40 every day
40 18 * * *       echo Hello Dave.

# run at 9am every Monday - Friday
0 9 * * mon-fri wget

# Run once a month
@monthly          /usr/local/bin/

Therefore the output generated is

 HOME = /srv
 LOGNAME = admin
 PATH = /usr/local/bin:/usr/bin:/bin

 Jobs next due -- Local time 2010-06-17T17:57:37+01:00
 Date                       Command
 2010-06-17T18:40:00+01:00  echo Hello Dave.
 2010-06-18T09:00:00+01:00  wget
 2010-07-01T00:00:00+01:00  /usr/local/bin/


The only environment variables that can be set within your crontab are PATH and MAILTO. All the rest are set automatically, and cannot be altered.

10.2. System scheduled tasks

There are various automated tasks which are executed upon a Symbiosis system. These scheduled tasks are responsible for automating things such as:

  • The addition of new IP addresses to your system.
  • The generation and upload of DNS data.

The following section document precisely which jobs are installed by default, along with their purpose.

These are the system tasks which are installed by default:

This carries the rudimentary password checks on mail and FTP passwords on an hourly and weekly basis.
This is responsible for launching any user-scheduled jobs, as described in Chapter 10, Scheduled tasks, and is run every minute.
The jobs here are responsible for checking for new blacklist and whitelist entries, as discussed in Section 8.5, “Blocking abusive remote hosts”. The whitelist and blacklists are regenerated every 15 minutes. The whole firewall is reloaded hourly.
This schedules the Symbiosis service monitor, which is described in Chapter 13, Service Monitoring. This is run every two minutes.
This regenerates DNS data for all the domains in /srv/, and triggers an upload to the Bytemark DNS server.
This manages rotation of the webserver log files for each domain.
This adds IP addresses configured by domains in config/ip to the host.
This task creates a per-IP Apache configuration file for new IP addresses, and is closely related to the previous task.