-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tarsnap can be tricked into skipping file using "touch -r" #542
Comments
I'm curious as to why you use Anyway, you're correct that tarsnap will avoid reading a file whose inode numbers, size, and mtime hasn't changed, as noted on https://www.tarsnap.com/efficiency.html. If you want to disable the cache entirely, you could use the (admittedly non-obviously-named) (This issue arose in another context a few months ago, so I was considering adding some documentation about this.) |
Yes. I often record video from screen using
I tried to find such option. I opened page https://www.tarsnap.com/man-tarsnap.1.html , then using "find in page" I searched strings "checksum", "mtime" and "ctime" and didn't find anything. It would be great if you add to man to --verylowmem something like: "this option doesn't look at mtime". There are programs, which manipulate mtime. I know at least one of them:
So, I think current tarsnap behavior is simply wrong, tarsnap could easily be tricked using such innocent tools as |
I'm tempted to say "don't do that then" -- assuming that "unmodified inode" means "unmodified file" is very common, and as you note it provides a very large performance benefit. In your case of recompressing a video, tarsnap will do the right thing anyway, since in addition to the modification time it also checks if the file size has changed. But yes, we could add an |
I found a perfect solution! Just always use ctime instead of mtime. I was not able to find way to set ctime to some past date. And modern versions of borg-backup use ctime instead of mtime for this purpose, here is their rationale: https://borgbackup.readthedocs.io/en/stable/usage/create.html#borg-create |
Wontfix would be my vote. UNIX™ file management and backup philosophy would lean to using the filesystem as the ultimate source of truth.
To mitigate this category of edge-case, it would require exhaustively scanning every byte of content &| hooking fs change notifications for continuous/periodic sync background tracking, both very expensive in different ways compared to the added value. ROI approaching epsilon. |
As well as I understand tarsnap takes into account file metadata when deciding whether to skip file. Unfortunately, this means that tarsnap can wrongly skip modified file if its metadata was changed in unusual way. I was able to change file metadata using
touch -r
and trick tarsnap into not making backing. Here is full log (b
is file with randomly generated content):I use tarsnap 1.0.40.
So, it seems any future tarsnap invocations will not backup new
c
version.This breaks my workflow, because I actually sometimes use command
touch -r
. Also I think it is possible some broken utils may create files with wrong metadata. And I want my backup software to be absolutely reliable in such cases.So, please always checksum files or add some option to always force checksumming.
rsync
has such option, it is named--checksum
The text was updated successfully, but these errors were encountered: