Created
December 26, 2012 19:57
-
-
Save esavard/4382660 to your computer and use it in GitHub Desktop.
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 | |
BACKUP_ROOT="$HOME/redmine_backup" | |
REDMINE_ROOT="/var/www/redmine" | |
BACKUP_FILENAME='backup_redmine_'`date +%Y%m%d`'.tar.bz2' | |
DB_DUMP_FILENAME='db_redmine_'`date +%Y%m%d`'.sqlc' | |
if [ ! -d "$BACKUP_ROOT" ]; then | |
mkdir $BACKUP_ROOT | |
fi | |
#backup postgresql database | |
export PGPASSWORD='xxxxxxxxx' | |
/usr/bin/pg_dump -U redmine -Fc --file=$BACKUP_ROOT/$DB_DUMP_FILENAME redmine | |
#backup config, attached files, plugins & assets and themes | |
tar -cjvPf $BACKUP_ROOT/$BACKUP_FILENAME $REDMINE_ROOT/config $REDMINE_ROOT/files $REDMINE_ROOT/plugins $REDMINE_ROOT/public/themes $REDMINE_$/public/plugin_assets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment