Parcourir la source

Fail backup script when rsync fails

Victor Lavaud il y a 9 mois
Parent
commit
bade2a7e11
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      backup/backup.sh

+ 1 - 1
backup/backup.sh

@@ -49,5 +49,5 @@ ssh -o StrictHostKeyChecking=no -l "${REMOTE_USER}" "${REMOTE_SERVER}" "mkdir -p
 
 cd ${LOCAL_FOLDER_PATH}
 echo "Copying files."
-rsync -e "ssh -o StrictHostKeyChecking=no" --verbose --archive "${link_parameter}" * "${REMOTE_USER}"@"${REMOTE_SERVER}":"${remote_folder}"
+rsync -e "ssh -o StrictHostKeyChecking=no" --verbose --archive "${link_parameter}" * "${REMOTE_USER}"@"${REMOTE_SERVER}":"${remote_folder}" || exit 20
 echo "Done copying files."