Created
February 23, 2024 14:36
-
-
Save NyaMisty/18a4b03fd3be41f85dcfec1721a9624d to your computer and use it in GitHub Desktop.
Revisions
-
NyaMisty created this gist
Feb 23, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/bin/bash # Change these parameters mntdir=/mnt/cache/_tmp_restic-snapshot dataset_name="cache" datasets=($(zfs list -t filesystem -H | cut -d$'\t' -f1 | grep -E '^'$dataset_name'(/|$)')) echo "Datasets selected: ${datasets[@]}" for d in "${datasets[@]}"; do mntsubdir=${d#"$dataset_name"} echo "Mounting dataset $d to ${mntdir}/${mntsubdir}" mount -t zfs ${d}@restic_bak_snapshot "${mntdir}/${mntsubdir}" done