[mythtv-users] Putting the mythconverg_backup.pl in a cron job
myth at robinhill.me.uk
Tue Nov 17 13:24:07 UTC 2009
On Tue Nov 17, 2009 at 08:03:59AM -0500, Harry Devine wrote:
> On 11/16/2009 02:41 PM, Michael T. Dean wrote:
> > On 11/16/2009 12:22 PM, Harry Devine wrote:
> >> On 11/16/2009 12:10 PM, Mike Holden wrote:
> >>> Harry Devine wrote:
> >>>> OK, so I want put the new mythconverg_backup.pl into a cron job,
> >>>> but I'm
> >>>> not having much success. I can run it from the command line and it
> >>>> runs
> >>>> fine, however, when I put it into a cron job, it never runs. I
> >>>> created
> >>>> a script called mythdb_backup under /cron/cron.daily as follows:
> >>>> #!/bin/sh
> >>>> mythconverg_backup.pl --rotate 7
> >>>> Pretty basic, but it never runs. How can I debug why its not running?
> >>>> I didn't see anything in /var/log/messages, but I may be looking in
> >>>> the
> >>>> wrong area.
> >>> Put the full path to the script in your crontab. The cron
> >>> environment is a cut-down
> >>> version of what you get when you log in, and not all the elements of
> >>> your $PATH are
> >>> avaiulable in your cron config.
> >> Thanks for the tip. I just made the change so I guess I'll find out
> >> tomorrow morning if it worked or not. Eventually I'd like to have it
> >> automatically SCP the file to another machine on my network, but for
> >> now, this is good enough.
> > Also, note that you /must/ have a valid HOME environment variable set
> > that refers to a HOME with a $HOME/.mythtv/config.xml and, really,
> > should have a $HOME/.mythtv/backuprc with at least a DBBackupDirectory
> > specified.
> > As a matter of fact, you probably want to do:
> > echo "rotate=7" >> $HOME/.mythtv/backuprc
> > so you don't run the backup script from the command-line without the
> > --rotate 7 and accidentally delete a couple of old backups. Then your
> > cron job command line becomes just:
> > mythconverg_backup.pl
> > Mike
> I did echo the DBBackupDirectory into ~/.mythtv/backuprc like the wiki
> says, but I just checked my backup directory and the file isn't there.
> So it appears like it didn't run. How can I determine why it hasn't?
> Are there any logs that I can check?
What users are you running things under? The cron.daily scripts will
run as root, so you may need to add an 'su' to the script to force it to
run under the correct user account.
( ' } | Robin Hill <myth at robinhill.me.uk> |
/ / ) | Little Jim says .... |
// !! | "He fallen in de water !!" |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: not available
More information about the mythtv-users