]> Git — Sourcephile - julm/podcasts.git/blob - send-offline.sh
init
[julm/podcasts.git] / send-offline.sh
1 #!/usr/bin/env bash
2 set -eux
3 cd "${0%/*}"
4 zfs_mount () {
5 for d in $(zfs list -rH -o name "$@")
6 do
7 mountpoint "/mnt/$d" ||
8 sudo zfs mount -l "$d"
9 done
10 }
11 zpool status off2 ||
12 sudo zpool import off2
13 zfs_mount off2/julm/public
14 # Backup config and cache
15 rsync -rv \
16 --inplace --partial --progress -i \
17 --exclude "*" --include ".*" \
18 old/{audio,video} /mnt/off2/julm/public
19 # Move content
20 rsync -rv --no-inc-recursive --info=progress2 \
21 --inplace --partial --progress -i \
22 --exclude ".*" --remove-source-files \
23 old/{audio,video} /mnt/off2/julm/public