#!/bin/bash
# /usr/local/bin/syncdivas
# http://crystalfaeries.net/posix/bin/syncdivas
# celeste:crystalfaery 2016-04-19 05:39:28+00:00
echo "`now` ======= $0 ======= $1 ======="
case `hostname` in
tomril)
cd /home/galleries/divas \
|| exit $?
# update myself from the subset on other systems
rsync -auvzH $1 pixy:/home/galleries/divas /home/video
# clean
# name_tidy -r
# do not update from me as I know others only hold a subset
# compute usage
dudir>.du.txt
;;
pixy)
cd /home/galleries/divas \
|| exit $?
# # update my subset of tomril divas
# for d in *;do
# rsync -auvzH $1 tomril:/home/galleries/divas/$d /home/galleries/divas
# done
# clean
# name_tidy -r
# update tomril from my subset
# rsync -auvzH $1 /home/galleries/divas tomril:/home/video
for d in *
do
rsync -auvzH $1 --delete $d tomril:/home/galleries/divas
done
# compute usage
dudir>.du.txt
;;
*)
echo "I have nothing to do on `hostname`."
;;
esac
echo "`now` ------- $0 ------- $1 -------"
exit $?
syntax highlighted by Code2HTML, v. 0.9.1