Last active
June 13, 2017 05:24
-
-
Save mche/db2375eb12849a12c0c334d2573aabe8 to your computer and use it in GitHub Desktop.
Бакапы на гитхабе
This file contains 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
cd ~/проектХ | |
# ветку бакапов | |
git branch backup | |
# crontab -e | |
NDAY=`date '+%u'` | |
WDAY=`date '+%A'` | |
57 3 * * * cd ~/проектХ; git checkout backup; pg_dump -U postgres --schema=public test | gpg -q --batch --yes -e -r my@email.ru --trust-model always -z 9 > public.$NDAY.pg.dump.gpg; git add public.$NDAY.pg.dump.gpg; git commit -m "$WDAY"; git checkout master; git push origin backup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment