diff --git a/scripts/unison_backup.sh b/scripts/unison_backup.sh index 2852e4b..6fbcaf8 100755 --- a/scripts/unison_backup.sh +++ b/scripts/unison_backup.sh @@ -3,13 +3,13 @@ tmp_file=$(mktemp) for profile in $@; do - res=$(${unison_exe} -batch $profile > ${tmp_file} 2>&1) - grep "Nothing to do: replicas have not changed since last sync" ${tmp_file} > /dev/null + res="$(${unison_exe} -batch $profile > ${tmp_file} 2>&1)" file_sync=$? - if [ ! $file_sync == 0 ]; + if [ "$file_sync" -ne "0" ]; then - echo $(more ${tmp_file}) + echo "return code $file_sync" + more ${tmp_file} fi done