[Linux-disciples] write to file from shell script
Jamie Forrest
jamie at jamieforrest.com
Tue Nov 15 23:46:15 EST 2011
> #!/bin/bash
>
> dumpfile=`date +%F-%H%M%S`_dump.sql
> cd /Users/jforrest/Projects/django-cnsltme/cnsltme/
> gondor sqldump primary > /tmp/$dumpfile
> cd /tmp
> tar -czf $dumpfile.tar.gz $dumpfile
> mv $dumpfile.tar.gz /Users/jforrest/Dropbox/Pirate/db_backup/
> rm $dumpfile
The issue here was that gondor was not in the path that cron was
looking at. Calling the full path with gondor made the script work
from cron.
Jamie
More information about the Linux-disciples
mailing list