8 ms·
(Alternative product recommendation, please downvote/remove if you feel that isn't appropriate) For Unix/Linux backups, may I suggest Borg Backup? It encrypts
by bloopernova 8y ago
(Alternative product recommendation, please downvote/remove if you feel that isn't appropriate)
For Unix/Linux backups, may I suggest Borg Backup? It encrypts and does dedupe astonishingly well. It also works over SSH incredibly fast, and restores are via a mounted FUSE filesystem so they're easy to pick and choose what you need. It prunes really well too, and is a single executable so it's easy to distribute via Ansible/Puppet/etc. I've been using it for several years and it hasn't failed me yet.
If y'all want to laugh at my bash scripting skills, I have a backup script that sends backup status to a Zabbix monitor server at https://gist.github.com/anthonyclarka2/cef41d201dd5b890dae6786010531aeb https://gist.github.com/anthonyclarka2/cef41d201dd5b890dae67... (I'd appreciate improvements to that script if anyone wants to critique)
- dmix 8y agoI don't see anything wrong with that bash script. It's well formatted and very simple, there aren't any functions or anything, just a single switch and two conditionals. Not much to optimize. Simple and explicit is better in shell scripts than being fancy.
- bloopernova 8y agoThank you, I really appreciate the feedback.
- StavrosK 8y agoBorg is hands-down the best backup utility I've used. I also use Borgmatic for some added niceties around checks/notifications/etc.
- garettmd 8y agoDoes anyone know how it compares to Restic? That's what I've been using and have been pretty pleased. It seems like the main difference is that restic supports integrations with other services, whereas Borg seems uses SSH for its connections
- marceloneil 8y agoBorg is also big on deduplication
- mrighele 8y agoDeduplication is one the things that drove me to Borg: it has the speed and space saving of an incremental backup but every single backup can be used as it was a full backup. It is also very easy to setup a pruning policy for old backups, so that you can say that you want to keep one backup per day for 90 days and after that only one backup per month for 2 years.
- bloopernova 8y agoThe dedupe in Borg is downright magical. I know I lose some space by keeping my hosts in separate repositories, but even then, I get insane space savings.
- StavrosK 8y agoRestic looks pretty interesting, I wasn't aware of it, thank you. I don't know how Restic can achieve its goals, since AFAIK you need a binary running on the server to diff/check data/verify restores/etc without transferring all that over the network. Borg runs a binary on the server to do this, that's why it can't easily back up to S3 et al.
- johntash 8y agoIIRC Restic keeps indexes of data it uploads to configured backends. I think it caches that index locally, but it can also download it from the remote backend to compare.
- johntash 8y agoI've used both Borg and Restic pretty heavily. I settled on Restic because it was much lighter on resources. A few of the servers I manage have small amounts of ram, but large amounts of data. Borg would often get oom-killed, but Restic wouldn't. Restic also starts uploading changes as soon as it sees them, whereas borg has to scan the entire list of files before it starts uploading changes. Unfortunately for multi-tb datasets with millions of files, borg would take hours just to scan all of the files. Pruning old archives also worked a lot better in Restic compared to Borg. If you're happy with Restic, I'd keep sticking with it.
- m3nu 8y agoI recently launched a backup service for Borg – https://www.borgbase.com https://www.borgbase.com. Also big on monitoring (email, pushover, webhook), as this is a common concern for backups. It just lacks terminal-based registration. :-) You could use the GraphQL API to manage everything from the command line if you really wanted.
- StavrosK 8y agoThis looks pretty cool, well done! I use rsync.net and am very satisfied, but yours looks great as well. I'm not a big fan of the initial price hike (the first 100 GB is 2 cents per GB instead of 1), but it looks like the service is well worth it.
- GordonS 8y agoThis looks good, and competitively priced too! What's the backend cloud storage?
- martinml 8y agoJust guessing here but probably Backblaze b2? It has a similar pricing.
- m3nu 8y agoCurrently it's on RAID boxes, but I'll move to CephFS soon. The data volume is getting too big to copy it around. Ceph allows you to nicely expand your storage over time and account for some failures on the way. Borg needs a "smart" backend with a filesystem, so it can't use only object-storage.
- millettjon 8y agoI've been using borgbase for a couple of weeks and am very happy with it.
- netok 8y agoIs there a limit to how many times I can download my backups?
- blattimwind 8y agoThe encryption in Borg is weak but otherwise it works well if it fits your use case.
- zeveb 8y agoHow so? When I glanced over it it looked trustworthy enough.
- metafunctor 8y agoCan you give more details on how the encryption is weak?
- blattimwind 8y agohttps://borgbackup.readthedocs.io/en/stable/internals/security.html#attack-model https://borgbackup.readthedocs.io/en/stable/internals/securi... > When the above attack model is extended to include multiple clients independently updating the same repository, then Borg fails to provide confidentiality (i.e. guarantees 3) and 4) do not apply any more).
- metafunctor 8y agoThanks for pointing this out. The first entry on the Borg FAQ [1] is “can I backup from multiple servers into a single repository” and the answer is basically “yes, but it might be slow”. Seems to me like it should say “not really, it's insecure and might be slow”, plus the tool should make it clear you're doing something unwise if you try it anyway. I've always shied away from shared backup repositories anyway, because it usually means data from host A can be read by host B, and that's just not what I usually want. The deployment instructions appear sane to me. [2] [1] https://borgbackup.readthedocs.io/en/stable/faq.html#can-i-backup-from-multiple-servers-into-a-single-repository https://borgbackup.readthedocs.io/en/stable/faq.html#can-i-b... [2] https://borgbackup.readthedocs.io/en/stable/deployment/central-backup-server.html https://borgbackup.readthedocs.io/en/stable/deployment/centr...
- throwawaymath 8y ago
- some-one 8y agoI am using zfs send and it works like a charm. Once you have configured filesystems for only data, you can use dedup on receiving system.
- dmd 8y agoI evaluated Borg and Restic and found that both of them fall over once you get to (what I consider to be) production level volumes; in my case that's ~1 PB and in the range of a billion files. Sadly, the only thing I've found so far that works at all at those scales is Bacula, and that is file-based -- i.e., if you have a gigabyte file that changes by one byte, it backs up the whole gigabyte again. Not ideal.
- ofrzeta 8y agoIn what way do they fall over? Also, did you file bug requests?
- dmd 8y agoThey start taking unrealistically large amounts of time to deal with their catalogs. For instance, with a 500 TB dataset, Restic on my (128 GB ram) server took over 4 days to do its prune operation.
- zoratu 8y agoIn that case, what do you use?
- dmd 8y agoWe're using Bacula, because in our case it's the only thing that works with our volume, and also works with tape (which is the only cost effective way we've found to archive multi petabyte datasets). But I'm not very happy about it, because it's insanely overcomplicated for no really good reason, and because of it being file-based.
- prirun 8y agoBackblaze has done some cost comparisons between LTO and cloud storage: https://www.backblaze.com/blog/lto-versus-cloud-storage/ https://www.backblaze.com/blog/lto-versus-cloud-storage/ If you're interested, I'm doing experiments with another site with 500T to backup, where I added sampling and sharding to HashBackup (I'm the author). Sampling allows you to do faster simulated backups to determine the best backup parameters to use. In his case, we determine that a very large block size - 64M - was the best way to backup his data. Sharding automatically partitions the filesystem so multiple backup can run simultaneously to get backup speed in the 250-400 MB/s range. It's more at the proof of concept stage, but having another large site to work with would be fantastic! A couple of the larger sites using HashBackup are EURAC (European Research Center) and HMDC (Harvard MIT Data Center)
- y4mi 8y agoYou should make a habit of setting set -euo Pipefail if "${DEBUG:-false}”; then set -x; fi The -o Pipefail is irrelevant in this case, as you're not using any.. but better it's there in case you ever extend the script. As others have pointed out: readability comes right after correctness in shell script, do keeping it simple as you have done is always a good idea.
- bloopernova 8y agoI hope you see this reply, I am sorry for it being so late: Do you have a link to a good explanation of why you'd set those? The "set -e" seems to indicate that the script would fail immediately if the borg backup job fails, which would prevent the Zabbix "send" command from alerting the monitoring system. Thank you for your feedback, it's given me more to learn and think about!
- y4mi 8y agoThere are quite a few examples around, just google the parameters 'set euo pipefail' (first hit [0]) you're right that just putting the set options on top of your file would be a bad idea. you need to write your script to actually account for these errors, making possible exitcodes entirely transparent 1 #!/bin/bash 2 3 set -euo pipefail 4 if ${DEBUG:-false}; then set -x; fi 5 6 function random_exitcode(){ 7 return $(( RANDOM % 5)) 8 } 9 10 function handle_error(){ 11 case "$?" in 12 1) echo "handling exitcode 1!";; 13 2) echo "handling exitcode 2!!";; 14 3) echo "handling exitcode 3!!!";; 15 *) echo "encountered unexpected exitcode: $?"; exit 2;; 16 esac 17 } 18 19 random_exitcode || handle_error or, if you don't like functions: random_exitcode || LAST_EXITCODE=$? case "${LAST_EXITCODE:=0}" in ... [0] https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-e...
- bloopernova 8y agoMany thanks, I very much appreciate the effort you put into your reply, and your followup.
- cyphar 8y agoI would follow up with a suggestion to also consider restic, which is very similar to Borg Backup -- except it doesn't have the restriction that the server needs to be "clever" (you can upload to S3 or any dumb blob store).
- Max_aaa 8y agoI just run borgbackup and backup to a local folder, and rsync to my home nas if I am connected to my home network. If I need to force a sync over the internet, there is a small shell script that would rsync the backup folder to the home nas. This allows me to run hourly backups even if there is no network connection (or limited bandwidth), and then just auto sync when I get home, or force a backup when I get a good connection.
- Groxx 8y agoFor bash scripting: have you seen shellcheck? It's a very solid first-pass for any script, and the codes it emits have excellent documentation: https://www.shellcheck.net/ https://www.shellcheck.net/
- bloopernova 8y agoYes I have, I made sure it passes shellcheck before posting it here :) I do sort of wish that Visual Studio Code had the "auto-fixes" already built for shellcheck's error messages. I should probably create those and make them available somewhere.