diff --git a/rsync_backup.sh b/rsync_backup.sh index 98de9af..015eb3b 100644 --- a/rsync_backup.sh +++ b/rsync_backup.sh @@ -19,6 +19,12 @@ delete_archive=true archive_with_date=true #archive_with_date=false +if ! which rsync >/dev/null 2>&1; then + echo "rsync is not installed. Installing..." + sudo apt-get update + sudo apt-get install -y rsync +fi + if [ "$mode" == "files" ]; then rsync -a --exclude-from=$exclude_file --password-file=$password_file $source $user@$ip::$destination else