Created
March 3, 2016 09:43
-
-
Save gmambro/80b26b9f7e8d2b73bca3 to your computer and use it in GitHub Desktop.
Simple script for running trac hotcopy
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 | |
TRAC_ADMIN=$(which trac-admin) | |
TRAC_LIB=/var/lib/trac | |
TRAC_BACKUP_DIR=/var/lib/backup/trac | |
if [ $# != 1 ]; then | |
echo "usage $0 <env>" | |
exit 1 | |
fi | |
env=$1 | |
env_dir=$TRAC_LIB/$env | |
if [ ! -d "$env_dir" ]; then | |
echo "Cannot find $env_dir" | |
exit | |
fi | |
if [ ! -d "$TRAC_BACKUP_DIR" ]; then | |
echo $TRAC_BACKUP_DIR does not exist | |
exit 1 | |
fi | |
backup_dir=$TRAC_BACKUP_DIR/$env | |
if [ -d $backup_dir ]; then | |
echo "removing old backup" | |
rm -rf "$backup_dir" | |
fi | |
$TRAC_ADMIN "$env_dir" hotcopy "$backup_dir" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment