#!/bin/sh
#
###  !!!   will be invoked by /etc/anacrontab  !!! with param -su
### if invoked without -su the owner must invoke this script !!!
#
#  updates the remote copy of the specified sites
#
# 110507,191227

su=0
for opt in $@; do
    echo $opt
    if test $opt="-su"; then
      $su=1
    fi
done

cd /home/john/.sitecopy

dirs="Foto Video"
for i in $dirs
do
if test $su -eq 1; then
   su -c "sitecopy --rcfile=.sitecopyrc-siteserver --logfile=./g-h-o-${i}-errs.log --update g-h-o-${i} | tee g-h-o-${i}.log" gerd
else
   sitecopy --rcfile=.sitecopyrc-siteserver --logfile=./g-h-o-${i}-errs.log --update g-h-o-${i} | tee g-h-o-${i}.log
fi
done

