[script] Add unison_backup script

This commit is contained in:
Mathieu Maret 2013-01-04 11:24:45 +01:00
parent c369e5f8bb
commit e6866c0ece
1 changed files with 11 additions and 0 deletions

11
scripts/unison_backup.sh Executable file
View File

@ -0,0 +1,11 @@
unison_exe="/usr/bin/unison"
tmp_file=$(mktemp)
res=$(${unison_exe} -batch > ${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