diff --git a/bash/backupscript b/bash/backupscript.sh similarity index 100% rename from bash/backupscript rename to bash/backupscript.sh diff --git a/bash/changestation b/bash/changestation.sh similarity index 100% rename from bash/changestation rename to bash/changestation.sh diff --git a/bash/deviantbg b/bash/deviantbg.sh similarity index 100% rename from bash/deviantbg rename to bash/deviantbg.sh diff --git a/bash/flv2mp4 b/bash/flv2mp4.sh similarity index 100% rename from bash/flv2mp4 rename to bash/flv2mp4.sh diff --git a/bash/fritzbox b/bash/fritzbox.sh similarity index 100% rename from bash/fritzbox rename to bash/fritzbox.sh diff --git a/bash/geo2gps b/bash/geo2gps.sh similarity index 100% rename from bash/geo2gps rename to bash/geo2gps.sh diff --git a/bash/getpanoramas b/bash/getpanoramas.sh similarity index 100% rename from bash/getpanoramas rename to bash/getpanoramas.sh diff --git a/bash/gps2gpx b/bash/gps2gpx.sh similarity index 100% rename from bash/gps2gpx rename to bash/gps2gpx.sh diff --git a/bash/gps2pc b/bash/gps2pc.sh similarity index 100% rename from bash/gps2pc rename to bash/gps2pc.sh diff --git a/bash/ipodvideo b/bash/ipodvideo.sh similarity index 100% rename from bash/ipodvideo rename to bash/ipodvideo.sh diff --git a/bash/m4a2mp3 b/bash/m4a2mp3.sh similarity index 100% rename from bash/m4a2mp3 rename to bash/m4a2mp3.sh diff --git a/bash/mountcrypt b/bash/mountcrypt.sh similarity index 100% rename from bash/mountcrypt rename to bash/mountcrypt.sh diff --git a/bash/mousewheel b/bash/mousewheel.sh similarity index 100% rename from bash/mousewheel rename to bash/mousewheel.sh diff --git a/bash/netdev b/bash/netdev.sh similarity index 100% rename from bash/netdev rename to bash/netdev.sh diff --git a/bash/panel b/bash/panel.sh similarity index 100% rename from bash/panel rename to bash/panel.sh diff --git a/bash/pc2gps b/bash/pc2gps.sh similarity index 100% rename from bash/pc2gps rename to bash/pc2gps.sh diff --git a/bash/presentation b/bash/presentation.sh similarity index 100% rename from bash/presentation rename to bash/presentation.sh diff --git a/bash/sync b/bash/sync.sh similarity index 77% rename from bash/sync rename to bash/sync.sh index fd10e67..77058c1 100755 --- a/bash/sync +++ b/bash/sync.sh @@ -24,10 +24,23 @@ # along with this script. If not, see . ## +# Hostname or IP address of remote box HOST=sea -MAX_SIZE=500 # Mbytes + +# Maximum file size. Larger files will be exluded +MAX_SIZE=500 + +# Nice factor for rsync NICENESS=10 -INTERVAL=30 # minutes + +# Interval in minutes to reschedule this script via at +# Set to 0 to disable +INTERVAL=180 + +# Choose own queue for sync jobs +# Uppercase letters will at let behave like batch +QUEUE=S + # Exclude files bigger than MAX_SIZE find $HOME -type f -size +$(($MAX_SIZE*1024))k > $HOME/rsync.large.exclude @@ -64,7 +77,8 @@ rsync \ --executability \ --links \ --compress \ - --progress --stats \ + --out-format=%f \ + --stats \ $HOME/ $HOST:$HOME/backup/ \ 2>&1 | tee -a $HOME/rsync.log @@ -81,8 +95,16 @@ if [ -x /usr/bin/notify-send ]; then -c "transfer.complete" \ -i "/usr/share/icons/gnome/256x256/actions/appointment.png" \ -u low -t 2000 \ - "Syncronisation comppleted" "$(tail -n16 ~/rsync.log)" + "Syncronisation completed" "$(tail -n16 ~/rsync.log)" +fi + +# Prune queue +JOBS=$(atq -q ${QUEUE} | cut -f 1 | xargs) +if [ -n "${JOBS}" ]; then + atrm ${JOBS} fi # Queue next run -echo "bash $0" | at "now + ${INTERVAL} minutes" +if [ ${INTERVAL} -ne 0 ]; then + echo "bash $0" | at -q ${QUEUE} "now + ${INTERVAL} minutes" +fi diff --git a/bash/boot b/bash/wakeonlan.sh similarity index 100% rename from bash/boot rename to bash/wakeonlan.sh diff --git a/bash/zyxel b/bash/zyxel.sh similarity index 100% rename from bash/zyxel rename to bash/zyxel.sh