04.06.2013 Views

UCS 2.4 - Univention

UCS 2.4 - Univention

UCS 2.4 - Univention

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10 Basic System Services<br />

first hard drive. The Grub root partition can be represented in this notation by the <strong>Univention</strong> Configuration<br />

Registry variable grub/groot.<br />

The root partition which is handed over to the booting kernel, is independent from the above notation. It<br />

can be changed via the <strong>Univention</strong> Configuration Registry variable grub/root, and has to be declared in<br />

standard Linux partitions syntax.<br />

10.9 Executing recurring actions with Cron<br />

Regularly recurring actions (e.g., the processing of log files) can be started at a defined time with the Cron<br />

service. Such an action is known as a cron job.<br />

10.9.1 Hourly/daily/weekly/monthly execution of scripts<br />

Four directories are predefined on every <strong>UCS</strong> system, /etc/cron.hourly/, /etc/cron.daily/,<br />

/etc/cron.weekly/ and /etc/cron.monthly/. Shell scripts which are placed in these directories<br />

and marked as executable are run automatically every hour, day, week or month.<br />

10.9.2 Defining local cron jobs in /etc/cron.d<br />

A cron job is defined in a line, which is composed of a total of seven columns:<br />

• Minute (0-59)<br />

• Hour (0-23)<br />

• Day (1-31)<br />

• Month (1-12)<br />

• Weekday (0-7) (0 and 7 both stand for Sunday)<br />

• Name of user executing the job (e.g., root)<br />

• The command to be run<br />

The time specifications can be set in different ways. One can specify a specific minute/hour/etc. or run<br />

an action every minute/hour/etc. with an *. Intervals can also be defined, for example */2 as a minute<br />

specification runs an action every two minutes.<br />

Some examples:<br />

30 * * * * root /usr/sbin/jitter 600 /usr/share/univention-samba/slave-sync<br />

*/5 * * * * www-data /usr/bin/php -q /usr/share/horde3/kronolith/scripts/reminders.php<br />

232

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!