summaryrefslogtreecommitdiff
path: root/rsync2eye.sh
diff options
context:
space:
mode:
Diffstat (limited to 'rsync2eye.sh')
-rwxr-xr-xrsync2eye.sh27
1 files changed, 23 insertions, 4 deletions
diff --git a/rsync2eye.sh b/rsync2eye.sh
index b665d62..80d136a 100755
--- a/rsync2eye.sh
+++ b/rsync2eye.sh
@@ -5,10 +5,27 @@
# Move files from Stan
# https://logbuffer.wordpress.com/2011/03/24/linux-copy-only-certain-filetypes-with-rsync-from-foldertree/
+
+thisyear=$(date +%Y)
+
src=st33v.ddns.net:/home/st33v/cams/
-dst=~/pix/ixus/2017/camz
+dst=~/pix/ixus/${thisyear}/camz
+if [ ! -d ${dst} ]; then
+ makedir -p ${dir}
+fi
+echo "$(date). Starting to move images from stan."
+begin=$(date +"%s")
rsync -a --remove-source-files --include='*/' --include='*.jpg' --exclude='*' -e "ssh -p 51337" $src $dst
+if [ $? -ne 0 ]; then
+ echo "rsync from stan failed with exit code $? - exiting"
+ exit 1
+fi
+
+termin=$(date +"%s")
+difftimelps=$(($termin-$begin))
+echo "$(($difftimelps / 60)) minutes and $(($difftimelps % 60)) seconds elapsed to copy from Stan."
+
# Is walrus mounted already?
mountpoint -q /mnt/eye
if [ $? -eq 1 ]; then
@@ -21,13 +38,15 @@ if [ $? -ne 0 ]; then
exit 1
fi
-echo "Backing up pix to walrus."
+echo "Starting at $(date). Backing up pix to walrus."
-begin=$(date +"%s")
+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."
+
+echo "Finished at $(date)"
+echo "$(($difftimelps / 60)) minutes and $(($difftimelps % 60)) seconds elapsed to copy to Walrus."