Duplicity replacement --> rsync Time machine-like backups

Hello Boys, at the end I made it work, I have problems with the inodes, I have to allocate 800K files.

I made an script to mount drives and execute the scripts (I’m not using pagaille script) and tmbackup script works so well.

How you configure the logs for the script?

Hi @hector !

Happy to see that more and more people find that script interesting.

Out of curiosity, why didn’t you use my script ? It has the advantage of keeping the whole nethserver backup logic functional (modules includes & excludes, databases handling, and so on).

Regarding the logs, the doc is here : https://github.com/laurent22/rsync-time-backup

You’ve a --log-dir parameter to specify the log destination. Take care, you’ll be responsible of deleting the old logs (they are normally deleted if the backup is successful).

If you need to further customise rsync’s parameter you can use the --rsync-set-flags command line parameter.

@hector, regarding your filesystem running out of inodes, it is not clear to me wether creating a hard links (rsync-time-machine relies heavily on them) increases the number of inodes used.

Anyway, this page explains and give some leads in case you run out of inodes.

Did you format the drive following the doc, namely mke2fs -v -T largefile4 -j /dev/sdc1 -L backup ? -T largefile4 makes it one inode for every 4 megabyte instead of default one node per 16K of disk space. It makes sense when using duplicity since it creates archives. rsync doesn’t.

You may also fomat your drive in XFS, there is no predefined inode count using this filesystem.

1 Like

I would love to format in XFS, but Ubuntu won’t recognize it (for my boss the ext4 is a headache: to locate info with bash is horrible, he need something familiar like windows to see the consistence of the data), I won’t use your script because I use an spare disk, I have to rotate it once at the month (secure info disk in a bank box) so i have to mount the drive manually, I declare de UUID of the disk in a bash script the mount and copy.

The rsync-time-backup script allows me to keep a version for 30 days and doesn`t use so much space also It does’nt recopy the same info in the same drive.

Thanks for the link and the clarify me the command I’m learning more here than SMEserver.

I’ve been using rsync for backup for about ten years, it’s worked nearly flawlessly for all of that time.

The only issue is inodes, lots and lots of inodes.

I’ve run out of them twice, I’ve learned that ‘df -i’ is my friend, and that XFS has more inodes than ext2.

One of the nice things about this form of backup is that you can mount the backup read/write, but share it as read only, and allow users to recover their own files, normal permissions persist, and they can only see what they should be able to in the first place.

1 Like

Thanks for this great script!

I’m having problems with files that have no write permissions. They get backed up, but when rsync_tmpbackup tries to expire old files, it cannot remove them, and it gives a “Permission denied” error. Normally I would add something like “–chmod u+w” to an rsync command to avoid this problem, but how can I do that with the nethserver backup script?

Any help would be appreciated…

Hi @ppw_1104 !

First of all : are you aware that the script has been included in the standard backup module in the latest NS versions ? You must configure it using Cockpit.

Hi @pagaille
Thanks a lot for the response. No, I did not know that, didn’t even know about Cockpit (sorry for my ignorance). I installed cockpit, and it recognizes the rsync-backup that I had already already configured through the CLI (using db). In Cockpit, I don’t see anything that could change the rsync behaviour, though (e.g., adding “–cmod u+w”).