rpsync (457B)
1 #!/bin/sh 2 3 if [ $# -lt 1 ]; 4 then 5 printf "usage: %s mailbox\n" "$(basename $0)" >&2 6 exit 1 7 fi 8 9 mailbox="$1" 10 11 export DOVECOT_PRESERVE_ENVS="SSH_AGENT_PID SSH_AUTH_SOCK" 12 dsynccmd="-u chrissi mirror ssh -p 443 -i /home/chrissi/.ssh/id_rsa chrissi@mail.r-36.net dsync -u chrissi" 13 14 dsync -m "${mailbox}" $dsynccmd 15 if [ $? -eq 0 ]; 16 then 17 printf "%s has been synchronized.\n" "${mailbox}" 18 exit 0 19 fi 20 21 printf "Synchronisation of %s failed.\n" "${mailbox}" 22 exit 1 23