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

"file changed while we backed it up" if file permission is changed during backup, even if the permission is same as before #8299

Open
bojan-future opened this issue Jul 22, 2024 · 4 comments

Comments

@bojan-future
Copy link

Have you checked borgbackup docs, FAQ, and open GitHub issues?

Yes

Is this a BUG / ISSUE report or a QUESTION?

BUG

System information. For client/server mode post info for both machines.

Client:

Your borg version (borg -V).

1.2.4

Operating system (distribution) and version.

Debian GNU/Linux 12 (bookworm) x86_64

Hardware / network configuration, and filesystems used.

Proxmox VM
/ is on ext4
/home/sharedfiles/ is available to the network using samba

How much data is handled by borg?

about 1.4 TB

Full borg commandline that lead to the problem (leave away excludes and passwords)

borg create --stats
$REPOSITORY::'{now:%Y-%m-%d_%H:%M}'
/home/sharedfiles

Describe the problem you're observing.

For some files I get the warning "file changed while we backed it up" even though I am positive the file has not changed (ie. old rar archive, or a video file).

Possible cause:

There is a cron job running every minute that changes the permissions on all shared files. The permissions on above mentioned files are same before and after the cron job.

Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

Yes
It happens each time I start borg create on this system

Include any warning/errors/backtraces from the system logs

@infectormp
Copy link
Contributor

I suppose this is the same problem as described in FAQ https://borgbackup.readthedocs.io/en/stable/faq.html#i-am-seeing-a-added-status-for-an-unchanged-file

@ThomasWaldmann
Copy link
Member

@infectormp no, that's something different (FAQ is about unexpected "M" status for the most recent file, but this is about "changed while we backed it up that single file").

@bojan-future A "file" consists of data and metadata. While in your case the data might be unmodified, I think borg noticed that you touched the metadata.

Guess the easiest way to solve this is to not run that cronjob while you run the backup with borg. Or you just ignore the warning, which should be harmless in that case.

Another solution might be not needing that permissions-cronjob at all, by doing things a bit differently, e.g. using ACLs or sgid or samba configuration (if that is a samba share).

@infectormp
Copy link
Contributor

@ThomasWaldmann I mean the root cause is the same. Metadata changed during the backup process.

@ThomasWaldmann
Copy link
Member

The root cause is different in the FAQ item: there, the root cause is that borg intentionally deletes the freshest file from the files cache, so it will show "A" for that file even if it is totally untouched.

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

3 participants