On 2021-12-30 11:37, Gary R. Schmidt wrote:
On 30/12/2021 20:03, Sebastian Suchanek wrote:
Hi everyone!

How exactly are "new" files, which have to be backed up, determined by
Bacula?

The reason for asking: Recently, I migrated my main data to a new set of hard drives. I did so by using "rsync -aH" which *should* leave all file
timestamps etc. untouched. After the migration was finished, also all
paths etc. were exactly the same as before, just with a new set of HDDs
"underneath". However, in the next scheduled Bacula run (which was
scheduled as Incremental), Bacula stared to backup *everything* of the
abovementioned data.
(I cancelled the job and will resume doing backups on this particular
fileset with next regular Full backup which is scheduled for the
upcoming Sunday anyway.)

So - what went wrong here and how could this have been avoided?

The inodes *all* changed, it is effectively a new file system, it will
need to be fully backed up.


The documentation says that Bacula decides what files to backup for
Incremental and Differential backup by comparing the change (st_ctime)
and modification (st_mtime) times of the file to the time the last
backup completed.

I performed a simple test exactly a month ago.
What changes during the restore is the change time (st_ctime).
That's why Bacula decides to backup restored files with the next
Incremental backup (after the restore).

The case with rsync copy is similar to the the restoration.
st_ctime is used to keep the time of the last change on the inode
(e.g. ownership, permissions, hard link count and maybe something else).
Rsync option -a (archive) includes options -r, -l, -p, -t, -g, -o, -D.
None of these options will preserve change time thus bacula will
see all the files as candidates for backup.

As Gary said, this is a new file system with newly created inodes
so all the files now probably have the change time that corresponds
to the time when the rsync did the copy.
This can be checked with the stat(1) tool.


Regards!

--
Josip Deanovic


_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to