New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Backuprar
Hi,
Thought I'd post this short script I made for doing my own backups using rar. I made it so I could host my backups on openvz containers without worrying about my files being too available, like my emails. It's a script which takes an existing local backup file or folder, stores it as an encrypted rar archive with password and then push's it using rsync to another server. It doe's a couple of other things too. Any who here's the script.
Requires: rar, ssh (public key preferred if you plan to automate it with a cronjob), rsync
Edit... http://fs5.co.uk/backuprar.txt
Easier to just post it as a text then figure out formatting
Comments
You mean how to format on the interwebs?
pre tag.
Doesn't come out nice using that..
I recommend using something like a GitHub Gist. It might be easier for some (wget directly to their server). Gists also allows for community edits and bug fixes (and adds to your Github portfolio).
:P
use .tar.gz instead of rar, since tar installed by default on most of system.
I am pretty sure the author has used rar to get a better compression result.
Actually between tar.gz and rar there isn’t much difference in compression. The point of using rar is to encrypt the file which as far as I know isn’t possible with tar.gz
If you want encryption, better use gpg, don't rely on rar's unknown and unverified algorithms.
Note that the "xz" format is not the "gz" format.
"xz" has a higher compression ratio than "rar5" even in some benchmarks.
"gz" on the other hand, balances fast, portable, and great compression ratio.
We should be using 7z.
7z is much better than tar.gz, and rar in compression ratios. Bzip's huffmans table just cannot compare against 7z's compression dictionary.
I would only use rar for it's recovery sectors - of which 7z, gz, xz, and zip lack.
In my case and as per the script there is no rar compression (since my backups are already compressed in .tar.gz by virtualmin). But yeah you're right 7z is slightly better than rar on compression
gpg is an alternative, I just personally use rar because it's user friendly on the windows side. rar uses AES256 as far as I know, so it's hardly an unknown and unverified algorithm
Make sense. Rar is also easier to increment backups than gz. Although I recommend keeping the use of tar (maybe even during a tar.rar) - because tar keeps the extended metadata (permissions, etc.) - for backups of linux systems.
He's talking more on the implementation side. Like SSL uses AES, but we all know what happened to OpenSSL. AES is considered safe, but there are always other ways to break the algorithms.
For automated backups encrypted by GnuPG I'm using Duply which is a wrapper for Duplicity. It uses rsync and can use quite a few storage backends including SCP, S3.
I'm considering switching to Box Backup because instead of a cron task, it runs all the time so the backups are always up to date. Pretty interesting, but also one more service that's constantly running.