config/scripts/unison_backup.sh

17 lines
256 B
Bash
Raw Normal View History

2013-01-04 11:24:45 +01:00
unison_exe="/usr/bin/unison"
tmp_file=$(mktemp)
2013-09-04 17:14:18 +02:00
for profile in $@;
do
res="$(${unison_exe} -batch $profile > ${tmp_file} 2>&1)"
2013-09-04 17:14:18 +02:00
file_sync=$?
if [ "$file_sync" -ne "0" ];
2013-09-04 17:14:18 +02:00
then
echo "return code $file_sync"
more ${tmp_file}
2013-09-04 17:14:18 +02:00
fi
done
2015-02-26 14:25:54 +01:00
rm $tmp_file