Last active
February 25, 2019 07:59
-
-
Save D4R4/8f3b9747c7f313236494318441fa808f to your computer and use it in GitHub Desktop.
postgres db for IBSng
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/bash | |
su postgres -c "pg_dump IBSng" > IBSng_"`date +%Y-%m-%d`".sql | |
#tar czf IBSng_"`date +%Y-%m-%d`".tar.gz IBSng_"`date+%Y-%m-%d`".sql | |
DELDATE=$(date -d "-31 days" +"%Y-%m-%d") | |
HOST=aaaa | |
USER=ssss | |
PASS=zzzzz | |
ftp -inv $HOST << EOF | |
user $USER $PASS | |
cd ibsng-backups | |
put IBSng_"`date +%Y-%m-%d`".sql | |
mdel IBSng_$DELDATE.sql | |
bye | |
EOF | |
DELDATE2=`date -d "-7 days" +"%Y-%m-%d"` | |
rm IBSng_$DELDATE2.sql | |
#rm IBSng_"`date +%Y-%m-%d`".tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment