[mythtv-users] crontab vs. anacron from a mythtv perspective
Jim Abernathy
jfabernathy at gmail.com
Fri Nov 9 15:18:15 UTC 2018
On 11/9/18 8:51 AM, Ian Cameron wrote:
> Or drop the correctly formated files into the /etc/cron.d/ directory.
> There are three good things about that option: firstly, they won't be
> changed by system upgrades; secondly, as well as supporting the
> standard crontab time specification, they have one additional field,
> that being the user to run as, i.e. no need to use sudo; thirdly the
> jobs are run at the exact time specified, unlike the jobs in the
> /etc/cron.{hourly,daily,weekly,monthly}/ directories, which are run
> sequentially by run-parts, which is triggered by cron.
>
> Cheers, Ian
>
So I ran my test cases. All worked.
1. Putting the scripts in /etc/cron.daily and adjusting the time that
anacron runs all it's daily jobs from midnight to 7:30am works, but, to
me, complicated.
2. sudo crontab -e works but since the file is controlled by the command
exclusively, you'd have to have the crontab formated line in a file to
cut and paste.
3. putting a one line file in /etc/cron.d to execute the scripts seems
easiest.
I left my scripts in $HOME and a copy of the file I want copied to
/etc/cron.d there as well.
The line below runs the backup followed by the optimize starting at
7:30am everyday.
30 7 * * * root /home/jim/mythtv-backup; /home/jim/optimize_mythdb
Jim A
More information about the mythtv-users
mailing list