summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2025-11-13 06:34:12 +0800
committerXiao Pan <xyz@flylightning.xyz>2025-11-13 06:34:12 +0800
commitca5c077434305423a7e6d0a845b71c0f07ee0448 (patch)
tree3a8d6964a8c6ec1cdc5309498ac2ec089c7a8e54 /sh
parentb8807265ddf1a17e8fb0bba09af469b16f2a4411 (diff)
upd workaroud xdotool input pass to duplicity gpg having issues
Diffstat (limited to 'sh')
-rwxr-xr-xsh/upd9
1 files changed, 9 insertions, 0 deletions
diff --git a/sh/upd b/sh/upd
index d00cf02..e8a6d99 100755
--- a/sh/upd
+++ b/sh/upd
@@ -120,6 +120,15 @@ backup () {
# because I noticed that root user's `tty` output is different, but my
# root user and xyz user's gpg keys are the same, so whatever for now.
# There maybe a better way instead.
+ #
+ # Note that input password to `sudo --preserve-env=GPG_TTY duplicity
+ # --use-agent` with my mod-a dwm hotkey, which uses sth. like `pass
+ # master | ... | xdotool ...`, will have issues of timeout or it shows
+ # I input wrong password, I need to typing password manually instead,
+ # not sure why, maybe due to xdotool input too fast. It can be
+ # workarounded by add gpg key to agent before running duplicity, this
+ # works because my root and xyz user use the same gpg key.
+ echo | sudo --preserve-env=GPG_TTY gpg -s >/dev/null
sudo --preserve-env=GPG_TTY duplicity --ssh-askpass --use-agent --encrypt-key 9790577D2BE328D46838117ED3F54FE03F3C68D6 --sign-key 05899270DF25BB1EEDF57BE824F769E5D08C9E9A --full-if-older-than 2Y --include /etc/.cfgs --include-filelist "/home/xyz/.config/myconf/upd_rsync_files" --exclude / / "sftp://xyz@ib.flylightning.xyz//home/xyz/backup/pp"
# pp no need duplicity backup to ca, because 321 backup rule is already
# satisfied: pp files in ~/.config/myconf/upd_rsync_files are backed up