[mythtv-users] mythconverg database maintenance and backup

Jim Abernathy jfabernathy at outlook.com
Sun Jan 14 13:34:42 UTC 2018



On 01/14/2018 08:00 AM, Stephen Worthington wrote:
> On Sun, 14 Jan 2018 12:26:48 +0000, you wrote:
>
>> I know I must be missing something simple.  Yesterday I worked to get the suggested optimize and backup scripts for mythconverg into the cron.daily directory.  I tested each of these scripts by running them as:
>>
>> sudo /etc/cron.daily/mythtv-backup
>>
>> sudo /etc/cron.daily/optimize_mythdb
>>
>> They both worked and I had the backup files where they should be and data in the syslog and /var/log/mythtv/optimize_mythdb.log files to indicate they ran okay.
>>
>> This morning anacron should have run at 6:25 my 2 daily scripts but it didn't and there is no indication in the syslog of it running. This is what I see at 6:25:
>>
>> Jan 14 06:25:01 mythbuntu CRON[11179]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
>>
>> I again manually ran the scripts as before and they work.
>>
>> Any idea on why they may not be running automatically?
>>
>> My crontab is below.
>>
>> Jim A
>>
>>
>> SHELL=/bin/sh
>> PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
>>
>> # m h dom mon dow user    command
>> 17 *    * * *    root    cd / && run-parts --report /etc/cron.hourly
>> 25 6    * * *    root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
>> 47 6    * * 7    root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
>> 52 6    1 * *    root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
>> #
> Do the files in the /etc/cron.daily directory have root ownership and
> the correct permissions?  This is what mine look like:
>
> root at mypvr:/etc/cron.daily# ll
> total 116
> drwxr-xr-x   2 root root  4096 Dec 20 23:33 ./
> drwxr-xr-x 189 root root 12288 Jan  1 03:30 ../
> -rwxr-xr-x   1 root root   311 Jun 20  2010 0anacron*
> -rwxr-xr-x   1 root root   539 Apr  6  2016 apache2*
> -rwxr-xr-x   1 root root   376 Apr  5  2014 apport*
> -rwxr-xr-x   1 root root  1474 Nov  1  2016 apt-compat*
> -rwxr-xr-x   1 root root   314 Mar 31  2012 aptitude*
> -rwxr-xr-x   1 root root   355 Jun  5  2013 bsdmainutils*
> -rwxr-xr-x   1 root root   384 Mar 24  2014 cracklib-runtime*
> -rwxr-xr-x   1 root root   532 Mar  9  2012 debsums*
> -rwxr-xr-x   1 root root  1597 Nov 27  2015 dpkg*
> -rwxr-xr-x   1 root root    56 Oct 17  2015 jfs-filestructure-backup*
> -rwxr-xr-x   1 root root   372 Oct  5  2011 logrotate*
> -rwxr-xr-x   1 root root  1293 Nov  7  2015 man-db*
> -rwxr-xr-x   1 root root   435 Jun 21  2013 mlocate*
> -rwxr-xr-x   1 root root  2069 Apr 21  2016 mythexport*
> -rwxr-xr-x   1 root root   844 Oct  8 01:28 mythtv-database*
> -rwxr-xr-x   1 root root   242 Jun 11  2010 mythtv-status*
> -rwxr-xr-x   1 root root  1387 Oct  6  2016 ntp*
> -rwxr-xr-x   1 root root  1298 Dec 31  2015 optimize_mythdb*
> -rwxr-xr-x   1 root root   249 Apr  9  2012 passwd*
> -rw-r--r--   1 root root   102 Apr  2  2012 .placeholder
> -rwxr-xr-x   1 root root  3449 Feb 27  2016 popularity-contest*
> -rwxr-xr-x   1 root root   383 Apr 13  2012 samba*
> -rwxr-xr-x   1 root root   441 Nov 11  2013 sysstat*
> -rwxr-xr-x   1 root root   214 Apr 20  2012 update-notifier-common*
> -rwxr-xr-x   1 root root  1046 May 20  2016 upstart*
>
> If the write permissions are too permissive, I think cron will not run
> them.
jim at mythbuntu:~$ ls -l /etc/cron.daily/
total 68
-rwxr-xr-x 1 root root  311 Dec 28  2014 0anacron
-rwxr-xr-x 1 root root  539 Apr  5  2016 apache2
-rwxr-xr-x 1 root root  376 Mar 31  2016 apport
-rwxr-xr-x 1 root root 1474 Jun 19  2017 apt-compat
-rwxr-xr-x 1 root root  355 May 22  2012 bsdmainutils
-rwxr-xr-x 1 root root 1597 Nov 26  2015 dpkg
-rwxr-xr-x 1 root root  372 May  6  2015 logrotate
-rwxr-xr-x 1 root root 1293 Nov  6  2015 man-db
-rwxr-xr-x 1 root root  539 Jul 16  2014 mdadm
-rwxr-xr-x 1 root root  435 Nov 18  2014 mlocate
-rwxr-xr-x 1 root root  842 Jan 13 07:14 mythtv-backup
-rwxr-xr-x 1 root root 1387 Sep  5 11:24 ntp
-rwxr-xr-x 1 root root  286 Jan 13 10:04 optimize_mythdb
-rwxr-xr-x 1 root root  249 Nov 12  2015 passwd
-rwxr-xr-x 1 root root 3449 Feb 26  2016 popularity-contest
-rwxr-xr-x 1 root root  383 Mar  7  2016 samba
-rwxr-xr-x 1 root root  214 May 24  2016 update-notifier-common
jim at mythbuntu:~$

> If you have an email system installed locally, then cron will email
> root a copy of the cron logs each day.
I'm adding postfix and setting up to get root mail now.

Jim A

> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org



More information about the mythtv-users mailing list