]> Sergey Matveev's repositories - dotfiles.git/blobdiff - bin/bin/zsnap
I tend to use age now
[dotfiles.git] / bin / bin / zsnap
index c25a9893179e0b4a48b30e96cc3e51b2c52bec34..367272ca819d2fe618dee2e5f2005bcc73ad3c0c 100755 (executable)
@@ -14,7 +14,7 @@ EOF
     exit 1
 }
 
-enccmd=(gpg --compress-level 0 --encrypt --recipient offline)
+enccmd=(age -R ~/.age/offline.pub)
 
 [[ $# -ge 2 ]] || usage
 
@@ -44,22 +44,22 @@ case $action in
         dst=$3
         [[ -d $dst ]] || usage
         setopt PIPE_FAIL
-        zfs send -Rv $latest | zstd | $enccmd > $dst/$latest_filename.zfs.zst.gpg
+        zfs send -Rwv $latest | zstd | $enccmd > $dst/$latest_filename.zfs.zst.age
         sync
         touch $dst/$latest_filename.from
         ;;
     sync)
         dst=$3
         [[ -d $dst ]] || usage
-        latest_dst=($dst/*~$dst/.*(.L0Onn[1]))
+        latest_dst=($dst/*.from~$dst/.*(.Onn[1]))
         [[ $latest_dst ]]
         latest_dst=${latest_dst[1]}
         latest_dst=${${latest_dst##*/}%.from}
         [[ $latest_dst != $latest_filename ]]
         setopt PIPE_FAIL
         set -x
-        zfs send -Rv -i ${latest_dst:gs#%#/} $latest | zstd | $enccmd > \
-            $dst/$latest_filename.zfs.zst.gpg
+        zfs send -Rwv -i ${latest_dst:gs#%#/} $latest | zstd | $enccmd > \
+            $dst/$latest_filename.zfs.zst.age
         set +x
         sync
         print $latest_dst > $dst/$latest_filename.from