0

I'd like rsnapshot to not create a second copy of all my files and instead just have hardlinks to the original files and only save a copy of changes.

I have a windows and linux server. I would like to have backups of my linux system stored onto the windows system. However I'd also like to have snapshots available for users.

I am running rsnapshot on linux in order to have snapshots. I cannot place the snapshot root on windows since I cannot preserve the file attributes on the different file system, therefore the snapshot resides on linux. This means now my files are using double the space (original and snapshot)

Since a snapshot is not a backup, I create a backup by zipping up my files and sending the zip file over to windows.

The issue is that since I am creating a separate backup, I have no need to keep two copies of the same file on linux. Therefore I'd like rsnapshot to not create a second copy of all my files and instead just have hardlinks to the original files.

Can I simply manually create the first retain/interval folder with all hardlinks? (cp -al)

1 Answer 1

3

The way rsnapshot works, on the first run, it creates a full copy.

On the next ones, it only stores the files that have changed. If a file hasn't changed, it creates a hard link to it.

This means now my files are using double the space (original and snapshot)

Yes. You have the working files, and snapshots.

The issue is that since I am creating a separate backup, I have no need to keep two copies of the same file on linux. Therefore I'd like rsnapshot to not create a second copy of all my files and instead just have hardlinks to the original files.

If what you want is for rsnapshot to not copy the whole tree on the first run, the issue is that since it's the same file, it can't detect the changes.

FILE_A   -> DATA1
RFILE_A1 -> DATA2

IF FILE_A == RFILE_A1:
  HARDLINK RFILE_A1 RFILE_A2
ElSE
  COPY FILE_A RFILE_A2

This is the basic logic.

If RFILE_A1 is a hardlink to FILE_A, the problem is that any change on FILE_A can't be detected since the underlying data is the same.

The simple explanation is, A Hardlink is a name. It points to data on the disc. So when you create an extra hardlink, you're reusing the disk data. So changes can't be detected.

 

Short answer (TL;DR), you can't. You need that first full copy.

Another option may be to use something like Git.

4
  • I see, it needs to keep a second copy so that it can have something to compare to. I suppose any program will have this issue because it needs to have something to compare to. I guess my real problem is I have no where to store the second copy because the only other system I have is windows.
    – eng3
    Jan 11, 2017 at 18:46
  • Do you have the disk space? It can use any directory on your system for it. If you're looking for storage in another computer in case it crashes, you can create a file, format it ext3 or ext4 and mount it. Then you can store that file on Windows if you want. As an alternative, maybe something like Git may work. Or maybe something like Duplicity, nongnu.org/duplicity Jan 11, 2017 at 18:47
  • I have the disk space but would prefer not to have my capacity go down by 50% because I have to keep a copy of my backup. However, I see what you mean. rsnapshot or any backup/snapshot program needs a point of reference to compare to. Normally this can reside on the backup system but since my backup system is a different file system format, I can't use that. I'll take a look a duplicity. The issue is that I would like a backup AND snapshots available to users (like previous versions in windows)
    – eng3
    Jan 13, 2017 at 0:53
  • damn it, time for me to abandon rsnapshot altogether. My disk space won't allow it. Aug 13, 2021 at 5:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.