config/scripts/unison_backup.sh

15 lines
302 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)
grep "Nothing to do: replicas have not changed since last sync" ${tmp_file} > /dev/null
file_sync=$?
if [ ! $file_sync == 0 ];
then
echo $(more ${tmp_file})
fi
done