Created
March 18, 2011 13:10
-
-
Save NKjoep/876038 to your computer and use it in GitHub Desktop.
This script will backup both your PostgreSQL databases of your jAPS Entando application.
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/bash | |
## Title: backup-japs.sh | |
# | |
## Description: This script will backup both your PostgreSQL databases of your jAPS Entando application. | |
## Will write in the current directoy two files: 2010-03-18-1406_PortalExamplePort.backup, 2010-03-18-1406_PortalExampleServ.backup | |
# | |
## Usage: backup-japs.sh host port username password project | |
## Example: backup-japs.sh localhost 5432 agile mypassword PortalExample | |
# | |
# | |
## Author: Andrea D. <[email protected]> | |
# | |
if [ "$1" = "" ] || [ "$1" = "-h" ] || [ "$2" = "" ] || [ "$3" = "" ] || [ "$4" = "" ] || [ "$5" = "" ]; then | |
echo Usage: $0 host port username password project | |
else | |
CURRENTNOW=`date +%F-%H%M` | |
PGPASSWORD=$4 | |
echo doing: pg_dump -i -h $1 -p $2 -U $3 -F t -b -v -f ${CURRENTNOW}_${5}Port.backup "$5Port" | |
pg_dump -i -h $1 -p $2 -U $3 -F t -b -v -f ${CURRENTNOW}_${5}Port.backup "$5Port" | |
echo doing: pg_dump -i -h $1 -p $2 -U $3 -F t -b -v -f ${CURRENTNOW}_${5}Serv.backup "$5Serv" | |
pg_dump -i -h $1 -p $2 -U $3 -F t -b -v -f ${CURRENTNOW}_${5}Serv.backup "$5Serv" | |
PGPASSWORD='' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment