Live data from Hacker News

An almost perfect rsync over SSH backup script

blog.zazu.berlin

11–20 of 130 posts

Re: An almost perfect rsync over SSH backup script

#11

Too complicated to even try to read. Rsync is great but I've switched to Borg for backups. Borg isn't perfect but it is a higher level approach to backups, as it were. Hetzner recently dropped the price of their Storage Box backup product to about 2 euro per TB per month, and Borg works nicely with it. Borg encrypts all the backup contents and conceals the metadata on the backup server, and yet you can (with the encr…

Make sure your borg repos are copying properly and in full!

I had a horrible realisation that my borg backups were timing out on the offiste copy, meaning the resulting offsite backup I had was non-existent. The heartbreaking error message Inconsistency detected. Please run "borg check [repository]" - although likely this is "beyond repair"

Course following the 3-2-1 rule you're probably good, but aye I'm treating borg repos as delicately as I would a striped raid now. I am also monitoring that `borg check` actually comes back successfully before considering the backup complete too :)

Also if you're in a small company, start up, etc.. Set yourself a 3-2-1+ backup system. + is the miracle backup that makes you look good.

Re: An almost perfect rsync over SSH backup script

#13
post #11

Too complicated to even try to read. Rsync is great but I've switched to Borg for backups. Borg isn't perfect but it is a higher level approach to backups, as it were. Hetzner recently dropped the price of their Storage Box backup product to about 2 euro per TB per month, and Borg works nicely with it. Borg encrypts all the backup contents and conceals the metadata on the backup server, and yet you can (with the encr…

Make sure your borg repos are copying properly and in full! I had a horrible realisation that my borg backups were timing out on the offiste copy, meaning the resulting offsite backup I had was non-existent. The heartbreaking error message Inconsistency detected. Please run "borg check [repository]" - although likely this is "beyond repair" Course following the 3-2-1 rule you're probably good, but aye I'm treating bo…

This is why you gotta test your backups too

Re: An almost perfect rsync over SSH backup script

#15
I wish more of these backup solutions (even simple scripts like this) would include zero trust features.

I'd like to have a backup system that I didn't just kludge together myself over a weekend that accomplishes both delta change detection and rotation as well as allows me to keep my data encrypted with a key only I control.

Re: An almost perfect rsync over SSH backup script

#16
post #2

Perfect? Ha. Wrong ps grep usage. MacOS specific. No shell quoting. At least he doesn't advocate rm -rf / by an incorrect usage of --delete.

> Perfect? Ha.

The cynic in me believes this was intentional to drive engagement and discussion.

It's that old adage of "if you want to learn something just say something wrong about it on the Internet" at work.

Re: An almost perfect rsync over SSH backup script

#19
Can't help but throw a couple cents/pennies around whenever an "almost perfect" or "advanced" script makes my knee jerk so wildly. So here goes. For this part:

    pro_on=$(ps aux | grep -c rsync)

    # if someone is using rsync
    # grep is also producing one entry so -gt 1
`grep` can be excluded from the output by putting square brackets around one character of the search pattern, like so:

    pro_on=$(ps aux | grep -c rsyn[c])
Also, this:

    minutes=$(($minutes - 1))
Can be more easily written as:

    ((minutes--))

Re: An almost perfect rsync over SSH backup script

#20
My go-to backup solution, that can also manage rsync over ssh (among plenty other things), is synbak[0]. Short wrapper script to automatically mount the backup medium and it's really simple to (automatically) run a backup job. I use encrypted (LUKS) USB drives for that at home. Highly recommend it.

For encrypted backups to e.g. a NAS, Duplicity[1] is my go-to choice (full backup every month or so, with incremental backup every day inbetween).

[0]: https://github.com/ugoviti/synbak

[1]: https://duplicity.gitlab.io/duplicity-web/

Post reply on HN