[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-tar] tar in incremental mode fails when directory is deleted along
From: |
Mark Lang |
Subject: |
[Bug-tar] tar in incremental mode fails when directory is deleted along the way |
Date: |
Thu, 11 Aug 2016 16:32:01 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 |
When tar is run in incremental mode and an implicitly traversed
directory is deleted while it is running, tar exits with exit code 2
(error message: "Cannot open: No such file or directory").
tar 1.23 treats this situation as a warning (exit code 1). tar 1.26 and
above (maybe also earlier) treats it as an error. In my opinion this
should not be an error because if a directory is deleted no one would
expect it to appear in the tar archive anyway. So a warning should be
sufficient.
Without --listed-incremental this is also just a warning.
Simple test script:
#!/bin/bash
TESTDIR=./tartestdir
rm -rf "$TESTDIR"
mkdir -p "$TESTDIR"/{1,2}
dd if=/dev/zero of="$TESTDIR/1/1" bs=1MB count=5
touch "$TESTDIR/2/2"
(sleep 2; rm -rfv "$TESTDIR/2") &
set -o pipefail
tar --listed-incremental=/dev/null -cvf - "$TESTDIR" | pv -L 1m > /dev/null
echo $?
rm -rf "$TESTDIR"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-tar] tar in incremental mode fails when directory is deleted along the way,
Mark Lang <=