Skill 2 in course 2.1: Users and Automation
Scheduling and Time
Run tasks once or on a schedule with at, cron and systemd timers, and keep the clock right with chrony.
You will be able to
- Schedule a one-off job with at and manage the queue.
- Write per-user and system cron jobs, read the five time fields without guessing, and debug a job that did not run.
- Create a systemd service and timer pair, test a calendar expression, and list or disable timers.
- Configure a system as a time client with chrony, check synchronisation, and set the time zone.
Lessons
- 01One-off and recurring jobs with at and cronRun a command later with at, and on a schedule with cron, for one user or for the whole system.
atatqatrmcrontabcrontab -e/etc/cron.d0/5 exercises - 02Scheduling with systemd timersPair a service with a timer, write a calendar expression, and let systemd catch up on missed runs.
systemctlsystemctl list-timerssystemd-analyze calendarsystemd-runOnCalendarPersistent0/5 exercises - 03Time zones and time service clients with chronySet the time zone, point the system at an NTP server with chrony, and check that it is really synchronised.
timedatectlchronycchronyc sourceschronyc tracking/etc/chrony.confsystemctl restart chronyd0/5 exercises