From 31d0d55c1ac6a58c74dc6383cfa95fbe96a20747 Mon Sep 17 00:00:00 2001 From: St33v Date: Mon, 6 Nov 2017 20:14:15 +1100 Subject: add rsync2eye.sh and a stub for meany.sh --- rsync2eye.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 rsync2eye.sh (limited to 'rsync2eye.sh') diff --git a/rsync2eye.sh b/rsync2eye.sh new file mode 100755 index 0000000..b665d62 --- /dev/null +++ b/rsync2eye.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# script to backup pix to walrus +# SJP 4 April 2017 + + +# Move files from Stan +# https://logbuffer.wordpress.com/2011/03/24/linux-copy-only-certain-filetypes-with-rsync-from-foldertree/ +src=st33v.ddns.net:/home/st33v/cams/ +dst=~/pix/ixus/2017/camz +rsync -a --remove-source-files --include='*/' --include='*.jpg' --exclude='*' -e "ssh -p 51337" $src $dst + +# Is walrus mounted already? +mountpoint -q /mnt/eye +if [ $? -eq 1 ]; then + echo "Mounting walrus/pix to /mnt/eye." + mount /mnt/eye +fi + +if [ $? -ne 0 ]; then + echo "Mounting walrus/pix failed - exiting" + exit 1 +fi + +echo "Backing up pix to walrus." + +begin=$(date +"%s") + +rsync -a /mnt/dox/pix/* /mnt/eye +#rsync -avn /mnt/dox/pix/* /mnt/eye + +termin=$(date +"%s") +difftimelps=$(($termin-$begin)) +echo "$(($difftimelps / 60)) minutes and $(($difftimelps % 60)) seconds elapsed for Script Execution." -- cgit v1.3