Last active
September 29, 2019 00:25
-
-
Save derwiki/9d6aa0455335483dbbf3b6235c7ed9b8 to your computer and use it in GitHub Desktop.
Simple and efficient mirroring of two hard drives using `rsync`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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