Skip to content
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

add options to ignore, but update ctime/mtime in files cache #4915

Open
ThomasWaldmann opened this issue Jan 8, 2020 · 2 comments
Open

add options to ignore, but update ctime/mtime in files cache #4915

ThomasWaldmann opened this issue Jan 8, 2020 · 2 comments

Comments

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Jan 8, 2020

From a mailing list post of mine:

[The borg user asking copied existing data to a new filesystem.]

Should I move to "--files-cache=mtime,size,inode" (Modify) to avoid long initial backup times when I resume my daily backups over ssh?

The problem is that ctime and inode number of all files have changed due to the copying to a new filesystem.

So, what's left is only "size", which [if it is the only criteria used] is rather weak.

If you are absolutely sure that all the files are identical as before (so even a weak "--files-cache=size" would be no problem), you could use that for the first backup.

Note: it is also important that the absolute paths of the files do not change.

https://github.com/borgbackup/borg/blob/1.1.9/src/borg/cache.py#L970

The code there deals with a change of the inode number in case of "cache hits" (read the comment above that line).

It does not deal with the ctime change though, but we could think about whether it makes sense to add some "C" and "M" modes that ignore the ctime/mtime for change detection, but update the cmtime value in the cache to either the current ctime ("C") or the current mtime ("M") of the file. With that, the 2nd backup from the new filesystem could go back to the usual --files-cache=size,ctime,inode without triggering a full backup.

Sadly, without that change and in a situation like yours, you could not enable ctime/mtime for change detection without triggering a full backup, but only --files-cache=inode,size (which also is a bit weak).

@ThomasWaldmann
Copy link
Member Author

As a side note: C and M options are only needed because we need to decide whether to update ctime or mtime, so it is not as easy as with the existing code for the inode number.

@ThomasWaldmann
Copy link
Member Author

New feature, moving to 1.1.12 milestone.

@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.11, 1.1.12 Feb 29, 2020
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.12, 1.1.13 Apr 6, 2020
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.14, 1.1.15 Sep 8, 2020
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.15, 1.1.16 Nov 10, 2020
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.16, 1.1.17 Feb 16, 2021
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.17, 1.1.x Jul 4, 2021
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.x, 1.2.x Feb 20, 2022
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.2.x, 2.x Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant