Rclone, hard links and updated files

Hi guys,

Does rclone unlink a hardlink before a copy if the content of the files are different, in the same way that rsync does?

Lets say I have a daily backup script routine which every day pulls down the contents of some directory on a server, creates a folder called “DAY{#}” and inside is some files which can be changed daily sometimes & sometimes not.
To save space, when I am copying into these backup folders I create hardlinks to the files that have not changed.

Now, if rclone does not recognise that the file is a hard link and updates the file inode directly rather than creating a new file with a new inode, then, every backup that I have made which is hard linked to that inode will point to the newly updated file rather than giving me the ability to create “snap-shots in time” in the same way that rsync would.

Perhaps what I’m saying is best explained here: https://earlruby.org/2013/05/creating-differential-backups-with-hard-links-and-rsync/

This is an important feature if one is trying to implement a snapshot backup rotation system ala Mike Rubel’s rsync backup approach. (see: http://www.mikerubel.org/computers/rsync_snapshots/ )

Many thanks for your time.

Reply to own post incase others are wanting to know:

ANSWER:
NO

Unfortunately,
Rclone does not behave well with hard links. Two observations noted:

1) Rclone does not recognise hard links and will overwrite original pointed to file
2) Rclone will delete all hard links to files when removing any file

The second observation was an especially unexpected big surprise.

So, if people are wanting to implement a snap-shot style backup approach using rclone they will have to get a little creative! I have some idea’s but if/when I get one working I’ll post here.