Created
September 22, 2012 20:11
-
-
Save ecarreras/3767662 to your computer and use it in GitHub Desktop.
Some backup scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 0 * * * /usr/bin/duplicity --no-encryption /home scp://$(hostname -s)@vampir//mnt/backup/servers/$(hostname -s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export PATH=$PATH:/usr/bin | |
LOCKFILE=/home/dbdumps/dumping.lock | |
touch $LOCKFILE | |
for DB in `psql -lAt | grep -v template | cut -d '|' -f1`; do | |
pg_dump --no-owner $DB | bzip2 > /home/dbdumps/$DB.sql.bz2 | |
done | |
rm $LOCKFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment