From 6a9b831035be8c09f01d2f2c52a27300bff045ba Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Tue, 17 Nov 2026 01:14:15 +0800 Subject: upd: rsync -t so run again will resume after ctrl-c rsync -vPu after ctrl-c then run it again it will not resume due to modification time is newer on destination file than source file. I find out that -t flag can fix it. With rsync -vPut, before transfer done the destination file mod time is 1980-1-1 so ctrl-c then run it again it will resume, after transfter done the file is ib iso's mod time so when run it again it will not run, this behavior see `man rsync` "--update, -u" section, this behaviro is what I want to achieve with -u. When running the cli, there should be one old iso file, the newly transferred file seems is another .archlinux-x86_64.iso.mcWpvK file. If I ctrl-c, it seems will `mv .archlinux-x86_64.iso.mcWpvK archlinux-x86_64.iso` so there will only exist one iso file which contain newly transferred data. Before this fix, I need to run things like `touch -d 2026-9-1 archlinux-x86_64.iso` to make mod time older so resume work. Note if drive somehow umount and mount again by itself and rsync stuck so I have to run ctrl-c, both .archlinux-x86_64.iso.mcWpvK and archlinux-x86_64.iso will exist after ctrl-c. So doing the following thing works before this commit: cp .archlinux-x86_64.iso.mcWpvK archlinux-x86_64.iso touch -d 2026-9-1 archlinux-x86_64.iso I guess no need touch cli after this commit which uses -t flag. --- sh/upd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sh') diff --git a/sh/upd b/sh/upd index 8f0a8a5..7e7b910 100755 --- a/sh/upd +++ b/sh/upd @@ -412,7 +412,7 @@ monthly_misc () { done #[ -d /run/media/xyz/Ventoy ] || die "No usb flash drive" - rsync -vPu ib:downloads/torrents/useful/archlinux*.iso /run/media/xyz/Ventoy/archlinux-x86_64.iso + rsync -vPut ib:downloads/torrents/useful/archlinux*.iso /run/media/xyz/Ventoy/archlinux-x86_64.iso # only check checksum and gpg signature on insp is sufficient for me, else too much work if curl -sS -o /run/media/xyz/Ventoy/archlinux-x86_64.iso.sig https://mirror.fcix.net/archlinux/iso/latest/archlinux-x86_64.iso.sig; then gpg --verify /run/media/xyz/Ventoy/archlinux-x86_64.iso.sig || die 'Arch iso gpg signature check failed' -- cgit v1.3.1