Even though anacron
behaves differently than does cron
, the idea is more-or-less the same -- if you need to run some group of tasks where subsequent tasks depend upon some prior task being completed, you want to place those task in sequence in one shell program (script). Things that do not depend upon some prior task completing can stand alone.
Something to be aware of in any case, ancron
, is that the shell that cron jobs run in by default is extremely limited. If you are going to be executing a program found in /usr/local/bin
, for example, it frequently is necessary to add that directory to the PATH
environment as well as any libraries found in /usr/local/lib
to the LD_LIBRARY_PATH
environment variable; e.g., at the top of your shell program
You would do the same for any other directories containing executables you would be using in the job.
One does wonder, though, why you would be using anacon
rather than just plain old cron
? It appears that the only real benefit is that a cron job will be run by anacron
if the system has been shut down for some reason when the system is restarted. If you don't expect (or experience) a lot of powered-off time...
Hope this helps some.