diff --git a/rsync_backup.sh b/rsync_backup.sh index 05b2cbf..ae3566f 100644 --- a/rsync_backup.sh +++ b/rsync_backup.sh @@ -13,6 +13,9 @@ archive_dir='archives/' mode='archive' #mode='files' +delete_archive=true +#delete_archive=false + if [ "$mode" == "files" ]; then rsync -a --exclude-from=$exclude_file --password-file=$password_file $source $user@$ip::$destination else @@ -26,7 +29,7 @@ else rsync -a --exclude-from=$exclude_file --password-file=$password_file $archive_dir/* $user@$ip::$destination - if [ $? -eq 0 ]; then + if [ $? -eq 0 ] && [ "$delete_archive" = true ]; then rm -f $archive_dir/* fi fi