In general, anacron works in such a way that it will only execute any job if it hasn't already been executed within its given "timespan" (hourly, daily, weekly and monthly).
So if you run anacron for the first time in a week, it will run the tasks scheduled for hourly, daily and weekly. If you run it just afterwards, no tasks will be run. If you run it after an hour, only jobs scheduled for hourly will be run etc.
To keep track of this, anacron saves a timestamp for each job run. And only if the scheduled "timespan" exceeds the timestamp the job is run again.
Now the -n
and -f
options are described in the anacron man page, and they do two distinctively different things.
The -f
option forces all jobs to be (re)run, ignoring the timestamps. This means if you run anacron several times just after each other with the -f
option, it will rerun all jobs - including those that are scheduled to only run daily, weekly and monthly.
The -n
option tells anacron to run relevant jobs now, taking timestamps into account, but ignoring the delays set in /etc/anacrontab
. The default delays (as evident from your output are):
cron.daily
- 5 minutes
cron.weekly
- 10 minutes
cron.monthly
- 15 minutes
In addition, the -n
option also includes the -s
option, so that the jobs are run in sequence (one after the other), as opposed to running the jobs for each "timespan" in parallel.
I think it's most clear to get an overview with a table:
Options |
Enforce timestamps |
Enforce delays |
Serial execution |
none |
Yes |
Yes |
No |
-s |
Yes |
Yes |
Yes |
-n |
Yes |
No |
Yes |
-f |
No |
Yes |
No |
-fs |
No |
Yes |
Yes |
-fn |
No |
No |
Yes |