D. Hugh Redelmeier via Talk wrote on 2025-10-28 19:02:
If you listed a pathname of a deleted file, would tar notice and treat it as deleted? Good question.
------------------------------------------------------ Creating 2.tar WITH "--listed-incremental=file.list" tar: ./source/file2: Cannot stat: No such file or directory tar: Exiting with failure status due to previous errors ------------------------------------------------------ So, tar doesn't mark file2 as deleted in the archive, it exits.
Furthermore, I would hope that tar doesn't do globbing too, so quoting the argument (to prevent glob expansion by the shell) should not work. Another good question.
First, passing the source folder as "./source/*" (minus quotes) makes the incremental restore *fail*, as file2 exists when done. Only file3 gets added to archive 2.tar, yet the extraction is broken, and the --listed-incremental=file.list has invalid contents. This is ... interesting. Another case of tar receiving a list of files instead of a folder. And, no, `tar` does not do its own globbing: ------------------------------------------------------ Creating 2.tar WITH "--listed-incremental=file.list" tar ${incr_type} -cvvf ${tarball_2} "${tar_source}*" tar: Cowardly refusing to create an empty archive Try 'tar --help' or 'tar --usage' for more information. ------------------------------------------------------ I'm still pondering if `tar` should be breaking the file.list contents when it receives parameters that are files, not folders. Seems it should throw up a warning, *at least*. Incremental archives when parameters are files, not directories, can lead to unexpected results!