Use external file change API


#1

From what I understand, urbackupclientbackend tracks changed files using a daemon.

Instead, I want to use CloudLinux’ fchange API, which provides the cloudlinux-backup-helper binary. The fchange API buffers a list of modified files in the kernel, reducing I/O and load. With just the timestamp, I can extract a list of changed files since that timestamp.

Example:

[root@clnocptest ~]# cloudlinux-backup-helper -t 1558090403 | cut -d ':' -f 2
/home/cltest1/.viminfo
/home/cltest1/6651
/home/cltest1/26620
/home/cltest1/12640
/home/cltest1/26272
/home/cltest1/1095

etc…

Is it possible to use external input to get changed files?


#2

I wasn’t aware of such an API, do you have a link to the source code/Linux patches?

Currently it doesn’t track file changes on Linux, but always indexes all files. Tracking only works on Windows. Linux doesn’t have an equivalent API.

Note, that it would also have to return file/directory deletions.


#3

I wasn’t aware of such an API, do you have a link to the source code/Linux patches?

It’s created by CloudLinux and only available on CloudLinux OS AFAIK, a commercial distribution.

It’s available in the ‘cloudlinux-fchange’ package:

[root@clnocptest ~]# yum list installed | grep fchange
cloudlinux- **fchange** .x86_64 0.2-6.el7.cloudlinux @cloudlinux-updates-testing

Note, that it would also have to return file/directory deletions.

It returns files that were deleted. It doesn’t explicitly specify they were deleted, though, just that they were changed.


#4

According to https://docs.cloudlinux.com/cloudlinux-fchange/#general it seems it records deletion. The low level access would perhaps be more appropriate for UrBackup, but I’m not sure it would not clash with the daemon they have running already (API might not work for multiple programs). Also I’m unsure how to handle changes of hard linked files. And it seems to ignore changes of uid<500 per default.

If they allow you to run CloudLinux on-premises, they should also give you the source code of the Linux module, since Linux is GPL v2.


#5

The actual fchange API is likely part of the CloudLinux LVE kernel and not a separate kernel module. Is that what you mean?


#6

It doesn’t matter if it is a separate kernel module or not. They probably use Linux internal GPL symbols and have to make the module GPL as well (or have to patch the kernel), so you can just get the source code and upload it to github or something.