From: Mart Lubbers Date: Tue, 24 Jul 2018 10:29:21 +0000 (+0200) Subject: backup script X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=de5c05200addd56fd51b2ce3efca58870b8642bb;p=dotfiles.git backup script --- diff --git a/shell/.config/tmux/config b/shell/.config/tmux/config index 7bf6ba8..127a0ed 100644 --- a/shell/.config/tmux/config +++ b/shell/.config/tmux/config @@ -17,3 +17,9 @@ bind H split-window -h # Start not at index 0 but at one for windows set -g base-index 1 + +# vi copy and pasting +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection +bind-key -T copy-mode-vi 'Space' send -X halfpage-down +bind-key -T copy-mode-vi 'Bspace' send -X halfpage-up diff --git a/shell/.local/bin/backup.sh b/shell/.local/bin/backup.sh new file mode 100755 index 0000000..d3a8c23 --- /dev/null +++ b/shell/.local/bin/backup.sh @@ -0,0 +1,33 @@ +#!/bin/sh +trap 'um' 0 1 3 6 15 +um () +{ + if mountpoint -q /mnt/backupdrive; then umount /mnt/backupdrive; fi +} + +start="$(date)" +if [ ! -n "$1" ] +then + echo "Was this script called from udev? I need the ID_FS_UUID_ENC variable" | tee /home/mrl/backup.log + exit 1 +elif mountpoint -q /mnt/backupdrive +then + cat< /home/mrl/backup.log &&\ + rsync --delete --bwlimit=20M -va /home/mrl/ /mnt/backupdrive/home/mrl >> /home/mrl/backup.log &&\ + umount /mnt/backupdrive &&\ + cat<