Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Long running tar command
- X-seq: zsh-users 30080
- From: Dominik Vogt <dominik.vogt@xxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Long running tar command
- Date: Sat, 28 Sep 2024 10:27:00 +0100
- Archived-at: <https://zsh.org/users/30080>
- In-reply-to: <CAH+w=7aewUu_EykGngDqoe-LEyrbcKqDF5nV6urhgo9f6-k3Lg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- Mail-followup-to: zsh-users@xxxxxxx
- References: <ZvdMJAkImbQ6Ziaj@localhost> <CAH+w=7aewUu_EykGngDqoe-LEyrbcKqDF5nV6urhgo9f6-k3Lg@mail.gmail.com>
- Reply-to: zsh-users@xxxxxxx
- Ui-outboundreport: notjunk:1;M01:P0:3jwMxXcceE0=;eKLZ2lqlTKz8FprjcfyC8YkSJWX 6kLE3EaT8dJwe65Lj/3IOX16YW2o7YjijqyyzalpH0lZsG6E8ymxUfW3BoY8JYX4VQZxrWQ3B o4ilNH2bdeitu6oqCLMeQU4g7vP2/Pm7piismh0G0DGWOCkm6syjB+x5m7/EuxlcNVFlNaVER ZdSnG7EmsqXhrflRCwIB0P3hbDyLfiOp3fn8xl/pEw9m9PGevGCYLK+Ey03u48R/74E4wX7fh Zo6CvdVBFGrGDTkIz9C3obRQqfTTUgASQp1BgkR3eOnxww9lMlT+vud5SyZQ46wp/RNJkkMzr iCXxl7dzUIRfBC5/m/MUaMSNB4aOWScuZZbjL4uPOC6PdmeMBOX169PLvdRZtcoHMYYG9b689 csggFjPB6eOlgXe9fqyadPAvEM+aXgAdLntLz1/Xjp0RCIdTcVFkO75rB367LRV+j8TdNdMXo i3QbIw+BndglSdWj587u8o4A7hjvpRCFQrVfxej97MfUrHkBf/KXOt7rYRVIc65akZzYd2JCm Fuq0SsPmaqF+kkGMF92tQvAAo3kgyD4WCGRyX36JxuHgEh1hlViabqWkPDkaA3asRqC85civw qhjq/8o4/Zehka53d2TRNXzlPPd6uvgozqTUA78pSX8Dnbl061JfVPZrYT90kMmn6PP1vHpD9 rM9EvCXmLCEH1waYTy4DExvNq4uqviBnTxbLDK+gYwR2qPsjK5NFJ9lhLOLPb7JU86nI8ogdR v0sLiMRFj28AmdlcivML78rJLdUlXhFATiMdtqPeUGuG4vJ69P9TKQWeEm6sFm55XLAuVAiCL 5b3Q6gBIxJ8/aaP3p9JZuBbQ==
On Fri, Sep 27, 2024 at 07:10:16PM -0700, Bart Schaefer wrote:
> On Fri, Sep 27, 2024 at 6:38???PM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
> >
> > tar c -v -f >(tee dest.tar | md5sum > dest.md5) /data > dest.list
> >
> > I'd also like to use the --verify tar option, but that does not
> > work because ">(...)" is not a seekable file descriptor. Any idea
> > how to get around this limitation?
>
> The --verify pass won't happen until the output file is fully written,
> so is it really slower to run a second tar command to do that?
I don't think it's slower, but tar has no way of verifying an
already existing archive. --verify works only with "tar -c".
(And it's unclear what --verify does in the first place because it
does _not_ compare file contents. Maybe it's equivalent to a
separate "tar -t".)
> That said, if you're on Linux / using modern GNU tools, you could do:
>
> : assure dest.tar exists and is empty >! dest.tar
> tar c -v -f --verify dest.tar /data > dest.list & tail -f --pid=$!
> dest.tar | md5sum > dest.md5
Great. I was already thinking about how a separate process could
detect that tar was finished writing the archive and wasn't aware
of the --pid option. A litte more tweaking is necessary to make
sure "dest.tar" already exists when tail is executed:
tar -c ... -f dest.tar ... & sleep 1; tail ...
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author