[Linux-disciples] write to file from shell script

Jamie Forrest jamie at jamieforrest.com
Tue Nov 15 23:10:12 EST 2011


> Add a cd /path/to/somewhere at the beginning.

Unfortunately, this didn't help:

#!/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


More information about the Linux-disciples mailing list