Jump to content

Incremental backups with rsnapshot


sunrat

Recommended Posts

I've always just used rsync and cron to keep backups of my user data, and clonezilla for doing a whole system image manually when big changes are afoot like dist-upgrades.

I've been a bit slack about setting it up on my current system so I finally decide to enact a backup plan. I'm using rsnapshot this time as it is primarily for incremental backups and allows you to specify how many iterations of backups to keep and how often to run it. rsnapshot uses rsync to do the actual backup.

I won't reinvent the wheel, pretty much just followed the excellent (as usual) guide on Arch wiki. This gives examples of how to run it regularly using systemd timers, rather than cron which most of the other guides use.

 

https://wiki.archlinux.org/index.php/Rsnapshot

Link to comment
Share on other sites

securitybreach

Nice. I have never used rsnapshot. I have always done the same as you and used rsync for daily backups and clonezilla for installation clones. I may have to check it out. thanks :thumbsup:

Link to comment
Share on other sites

securitybreach

It just seems to be focussed on simple configuration of incremental backups. rsync alone needs to be fed some extra options but yes, ultimately will do the same thing. I wouldn't change if you have rsync configured how you like unless you are just curious.

  • Like 1
Link to comment
Share on other sites

securitybreach

It just seems to be focussed on simple configuration of incremental backups. rsync alone needs to be fed some extra options but yes, ultimately will do the same thing. I wouldn't change if you have rsync configured how you like unless you are just curious.

 

I thought rsync was simple enough but I guess not:

 

 comhack@Cerberus ~ % crontab -l
00 15 * *  * rsync -ar ~/Videos /Various/Music ~/Documents ~/Downloads ~/Pictures ~/Shared ~/scripts/ /MEDIA

Link to comment
Share on other sites

I thought rsync was simple enough but I guess not:

 

 comhack@Cerberus ~ % crontab -l
00 15 * * * rsync -ar ~/Videos /Various/Music ~/Documents ~/Downloads ~/Pictures ~/Shared ~/scripts/ /MEDIA

I never used rsync like that. How does it handle new versions of changed files? I always just used --delete to only keep the latest version. rsnapshot creates a new folder for each snapshot and rotates them once x snapshots are made.

PS: -r is redundant as -a includes it. ;)

 

PPS: I just did a little more searching. rsnapshot would do similar to:

rsync -ab --backup-dir=old_`date +%F` --delete --exclude=old_* source/ destination/

although you'd still need to work out a way to rotate the backups so you don't end up keeping them all. I think you'd only get the changed files in each old directory rather than a full backup in each one via hard links with rsnapshot.

Link to comment
Share on other sites

securitybreach

-a

indicates that files should be archived, meaning that most of their characteristics are preserved (but not ACLs, hard links or extended attributes such as capabilities)

 

-r, --recursive

 

recurse into directories

 

Basically it just syncs new changes on the source.

Link to comment
Share on other sites

After several decades of a "drag and drop if/when I ever remember to do it" backup philosophy, I just started using Back in Time, which is basically a Python 3 wrapper for rsync if I understand it correctly. Once I set up the initial profile it was a cinch to use, but I still need to take a closer look at the available options to get the most out of it.

Link to comment
Share on other sites

-a, --archive			   archive mode; equals -rlptgoD (no -H,-A,-X)

Just sayin' you don't need to add -r when using -a .

Link to comment
Share on other sites

securitybreach

-a, --archive			 archive mode; equals -rlptgoD (no -H,-A,-X)

Just sayin' you don't need to add -r when using -a .

 

I hear you but I am going to leave it the way it is.

Link to comment
Share on other sites

I'm having a hard time configuring the systemd timers. It's not quite explained completely in the Arch wiki. Will know tomorrow if it's working. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...