Last active
March 4, 2021 08:02
-
-
Save glebov21/fe885b07e5174c642276cabcd796b3dc to your computer and use it in GitHub Desktop.
pgdump
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
#!/bin/sh | |
pathB=/data/pgbackup | |
dbUser=postgres | |
database=aerodb | |
mkdir -p $pathB | |
chmod 775 -R $pathB | |
find $pathB -mtime +61 -delete | |
su $dbUser -c "/usr/bin/pg_dumpall --database=$database | gzip > $pathB/pgsql_$(date -u "+%Y-%m-%d").sql.gz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment