[Borgbackup] (too) many modified files

Dan Christensen jdc at uwo.ca
Tue Jun 20 14:46:54 EDT 2023


On Jun 20, 2023, Boris Kirkorowicz <bkborg at kirk.de> wrote:

> Am 20.06.23 um 17:22 schrieb Alexander Kiselyov:
>> On Tue, 2023-06-20 at 12:31 +0200, Boris Kirkorowicz wrote:

>>> Am 17.06.23 um 18:35 schrieb Thomas Waldmann:
>>>> Using mtime is a bit less safe, as weird applications can
>>>> set it to arbitrary values.
>>>
>>> I expected that mtime is set by the file system →?
>>
>> It can be easily manipulated by a userspace program, e.g. via `touch`.
>
> isn't it the same with ctime? AFAICS e.g. chmod changes ctime, even if
> there are no changes, or chown.

ctime is set to the *current* time when a file is changed.  However,
mtime can be set to an *arbitrary* time by a userspace program.
So you can edit a file, and then change the mtime to what it was
before the edit.  That's why it isn't as safe to use mtime to determine
whether a file has changed.

And some "weird" programs that do this are borg, tar, touch, some
version control systems, etc.

For example, when you untar a tar file, tar sets the mtime to the
original mtime, while the ctime is set to the current time.

Dan


More information about the Borgbackup mailing list