by L Schmidt
anacron is a scheduler for non-accurately timed periodical script execution. Scripts are executed at hourly, daily, weekly and monthly intervals.
This flow, when launched, creates directories hourly, daily, weekly and monthly as subdirectories of a configurable directory, defaulting to the name "anacron". For a script to get executed at the desired interval, place it in the corresponding directory. Each directory can hold an arbitrary number of scripts.
By default, sh will be used to execute these scripts. For scripts beginning with a hashbang, the interpreter specified there will be used instead. Note that the home directory that interpreter changes to may be different from /storage/emulated/0 to which automate shell command execution defaults to - use canonical paths or change to the desired directory in your script.
I'm using anacron mostly for launching bash scripts which rotate logs, remove historic logs, rsync mobile devices with NAS, trimming file systems. I'm considering to introduce a "boot" directory next to the periodic execution directories.
Rate and review within the app in the Community section.