From 1399982b37a114e3db5c9d6cb43dfb3e551d155c Mon Sep 17 00:00:00 2001 From: Ole Morud Date: Mon, 17 Aug 2026 22:12:57 +0200 Subject: [PATCH] gd: wrap files with tar as well --- zsh/aliases.zsh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index f638d87..5583aeb 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -68,31 +68,33 @@ gd-check() { # gd-push pushes a file to Google Drive with compression and password encryption gd-push() { gd-check || return - zstd -6 -T0 -c -- "$1" \ + tar cf - "$1" \ + | zstd -6 \ | gpg -c -z 0 -o - \ - | rclone rcat "gdrive:backups/${1:t}.zst.gpg" + | rclone rcat "gdrive:rclone/${1:t}.tar.zst.gpg" } # gd-push pulls a file from Google Drive, password decrypts and decompresses it. # gd-push outputs to stdout gd-pull() { gd-check || return - rclone cat "gdrive:backups/${1:t}.zst.gpg" \ + rclone cat "gdrive:rclone/${1:t}.tar.zst.gpg" \ | gpg -d \ - | zstd -d -c + | zstd -d -c \ + | tar x - } # gd-ls lists all the files available on Google Drive gd-ls() { gd-check || return - rclone lsf --files-only gdrive:backups/ \ - | sed -n 's/\.zst\.gpg$//p' + rclone lsf --files-only gdrive:rclone/ \ + | sed -n 's/\.tar\.zst\.gpg$//p' } # gd-rm removes a file from Google Drive gd-rm() { gd-check || return - rclone deletefile "gdrive:backups/${1:t}.zst.gpg" + rclone deletefile "gdrive:rclone/${1:t}.tar.zst.gpg" } # dispatcher for gd functions