test mode

This commit is contained in:
Bob Mottram 2015-12-23 10:29:55 +00:00
parent 8b522cbf13
commit 429c169d0b
1 changed files with 9 additions and 1 deletions

View File

@ -548,8 +548,13 @@ function backup_extra_directories {
done <$BACKUP_EXTRA_DIRECTORIES done <$BACKUP_EXTRA_DIRECTORIES
} }
TEST_MODE="no"
if [[ "$1" == "test" ]]; then
TEST_MODE="yes"
fi
backup_configuration backup_configuration
if [[ "$1" != "test" ]]; then if [[ $TEST_MODE == "no" ]]; then
backup_users backup_users
backup_letsencrypt backup_letsencrypt
backup_gnusocial backup_gnusocial
@ -596,6 +601,9 @@ do
fi fi
done done
if [[ $TEST_MODE == "yes" ]]; then
echo "rsync -ratlzv --rsh='/usr/bin/sshpass -p \"$REMOTE_PASSWORD\" ssh -p $REMOTE_SSH_PORT -o StrictHostKeyChecking=no' $SERVER_DIRECTORY/backup $REMOTE_SERVER"
fi
rsync -ratlzv --rsh="/usr/bin/sshpass -p \"$REMOTE_PASSWORD\" ssh -p $REMOTE_SSH_PORT -o StrictHostKeyChecking=no" $SERVER_DIRECTORY/backup $REMOTE_SERVER rsync -ratlzv --rsh="/usr/bin/sshpass -p \"$REMOTE_PASSWORD\" ssh -p $REMOTE_SSH_PORT -o StrictHostKeyChecking=no" $SERVER_DIRECTORY/backup $REMOTE_SERVER
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
echo "$NOW Backup to $REMOTE_SERVER failed" >> /var/log/remotebackups.log echo "$NOW Backup to $REMOTE_SERVER failed" >> /var/log/remotebackups.log