cron help

Matthew Gillen me at mattgillen.net
Tue Feb 19 07:45:12 EST 2008


Is the exec bit set?

You could also add "-x" as the second line, and then check root's mail to
see what it actually tried to do.

Also, you might make sure that ruby et al are in the $PATH that cron is using...

HTH,
Matt

James Kramer wrote:
> I have a script that I use to backup my data files to the Amazon S3.
> For it to work I need to run is as sudo (root).  I placed this script
> into /etc/cron.weekly.  It does not run in cron.  How can I get the
> script to run.  Here is the  script
> 
> #!/bin/bash
> 
> # This script backups /jdata to Amazon S3
> 
> EXCMDS="-vs"  # you can add -n in here for testing, remove s for
> non-ssl, remove verbosity, etc
> SENDMAIL=/usr/sbin/sendmail
> EMAIL=root at localhost
> 
> cd /usr/local/s3sync
> 
> echo -e "To: ${EMAIL}\nSubject: s3backup results\nContent-type:
> text/plain\n\n" > /tmp/s3backup.log
> 
> #pg_dumpall -Ucdmoyer | gzip > /opt/www/db/pg_dumpall.gz
> #/root/.pgpass is needed for this
> ./s3sync.rb  ${EXCMDS} --delete -r /etc/ jdata_backup:etc >> /tmp/s3backup.log
> ./s3sync.rb  ${EXCMDS} --delete -r /jdata/ jdata_backup:jdata >>
> /tmp/s3backup.log
> ./s3sync.rb  ${EXCMDS} --delete -r /home/jmkramer/.tomboy
> jdata_backup:tomboy >> /tmp/s3backup.log
> 
>  cat /tmp/s3backup.log | ${SENDMAIL} "${EMAIL}"
> 
> Thanks for the help
> Jay
> 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the Discuss mailing list