Run /usr/local/sbin/weekly-backup every seven days, wait ten minutes after startup, and use job ID weekly_backup.
Which entry is appropriate?
anacrontab fields are period, delay, job identifier, and command in that order.
Detailed explanation
10 7 weekly_backup /usr/local/sbin/weekly-backupIncorrect. It reverses the period and delay fields.
7 10 weekly_backup /usr/local/sbin/weekly-backupCorrect. It uses seven days, ten minutes, the ID, and the command in order.
7 weekly_backup 10 /usr/local/sbin/weekly-backupIncorrect. The delay and job-ID positions are reversed.
weekly_backup 7 10 /usr/local/sbin/weekly-backupIncorrect. The job ID does not come before the period.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' '7 10 weekly_backup /usr/local/sbin/weekly-backup' | awk '{print $1, $2, $3}'Expected result
7 10 weekly_backupKey points
- period is days
- delay is minutes
- Job ID is unique
Notes
- Environment: POSIX awk / 模擬エントリのみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Cron
A scheduler for recurring jobs described by a time-field table.
at
A scheduler for one-time jobs queued for a specified time.
Anacron
A scheduler that can run periodic jobs after a system was unavailable.