]>
Git — Sourcephile - gargantext.git/blob - bin/backup
3 # 0 3 * * * pg_dump --dbname=$MYDB | gzip > ~/backup/db/$(date +%Y-%m-%d).psql.gz
5 if [[ $1 == "" || $2 == "" ]]
6 then echo "USAGE : ./psql gargantext.ini backup_directory"
12 grep $1 $INIFILE | sed "s/^.*= //"
15 USER
=$(getter "DB_USER")
16 NAME
=$(getter "DB_NAME")
17 PASS
=$(getter "DB_PASS")
18 HOST
=$(getter "DB_HOST")
19 PORT
=$(getter "DB_PORT")
22 GARGDB
="postgresql://${USER}:${PASS}@${HOST}:${PORT}/${NAME}"
24 #echo "backuping $GARGDB"
25 pg_dump
--dbname=$GARGDB | gzip > $2/$(date +%Y-%m-%d).garg_dump.gz