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 | |
# Use Case: Plug in USB hard drive, run the script, wait for notification, unplug drive. | |
# This script assumes you've already set up sanoid, syncoid, cron (with flock), and the pools. It's essentially a wrapper for the following commands: | |
# ------------------------------------------------------------------ | |
# zpool import tank-backup | |
# sanoid --cron --verbose # pruning on both pools | |
# syncoid --skip-parent --recursive --compress lzo tank tank-backup | |
# zpool export tank-backup | |
# ------------------------------------------------------------------ | |
# This could be modified to work on specific datasets but I don't have a need for that right now. |