[Linux-disciples] write to file from shell script
Jamie Forrest
jamie at jamieforrest.com
Tue Nov 15 23:11:42 EST 2011
Sorry there's a typo below. It should be:
#!/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
On Tue, Nov 15, 2011 at 11:10 PM, Jamie Forrest <jamie at jamieforrest.com> wrote:
>> 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
>
--
http://about.me/jamieforrest
More information about the Linux-disciples
mailing list