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