Skip to content

Instantly share code, notes, and snippets.

@derwiki
Last active September 29, 2019 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save derwiki/9d6aa0455335483dbbf3b6235c7ed9b8 to your computer and use it in GitHub Desktop.
Save derwiki/9d6aa0455335483dbbf3b6235c7ed9b8 to your computer and use it in GitHub Desktop.
Simple and efficient mirroring of two hard drives using `rsync`.
# These commands are to be run in different tmux panes to quickly copy the
# contents of one hard drive to another. `rsync` is used for it's robustness,
# interruptibility, and efficiency in incremental updates.
#
# After the initial clone, the same `rsync` command can be run to copy just the
# new/changed files from source to target.
# tmux pane 1
rsync --inplace --whole-file --partial --progress -a /Volumes/amsterdam/ /Volumes/stockholm/
# tmux pane 2
# use `watch` to record how much space is taken (via `df`)
watch -n 60 "bash monitor.sh | tee -a transfer-times.txt"
# tmux pane 3
# live view of most recent log entries
watch -n 60 "tail transfer-times.txt"
#!/bin/bash
echo `date`,`df -h | grep amsterdam | awk '{print $3}'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment