Slackware HowTo

Use crontab on Slackware for scheduled jobs

Reliable cron jobs with rc.crond, correct syntax, and practical debugging.

1. Enable cron

chmod +x /etc/rc.d/rc.crond
/etc/rc.d/rc.crond start

2. Edit crontab

crontab -e
crontab -l

3. Cron syntax (5 fields)

* * * * * command
| | | | |
| | | | +-- day of week (0-7)
| | | +---- month (1-12)
| | +------ day of month (1-31)
| +-------- hour (0-23)
+---------- minute (0-59)

4. Useful examples

# Every night at 03:00
0 3 * * * /usr/local/sbin/backup-rsync.sh

# Every 15 minutes
*/15 * * * * /usr/local/sbin/disk-check.sh

5. Best practices

*/10 * * * * /usr/local/bin/script.sh >> /var/log/script.log 2>&1
The cron environment is minimal: variables like PATH can differ from your interactive shell.

6. Debug

tail -n 100 /var/log/messages | grep cron
sh -x /usr/local/bin/script.sh

Quick checklist

[ ] rc.crond enabled
[ ] Job present in crontab -l
[ ] Script tested manually
[ ] Absolute paths used
[ ] Job logs checked

Back to the Linux HowTo section