Skip to content

Backblazing…

So there is Backblaze B2. It’s a service where you can buy bulk disk space online for backup and restore.

I have a Linux server at home, which many harddisks and which downloads and saves all data from the various dedicated servers and cloud instances, receives several time machine backups from the inhouse Apples, and has local git repositories and stuff.

I mirror these things from the production filesystems to a set of mostly offline disks once, and I wanted an off-site backup as well for crash recovery. Bandwidth is not a problem, we are living on FTTH with 500/500.

So there is rclone for this. It’s like rsync for B2 or other services.

Like so:

#! /usr/bin/perl -w
 
use strict;
use File::Basename;
use POSIX;
 
my $fstab        = "/etc/fstab";
my $backup_to    = "crypt:backup";
 
sub folders {
  my @result = (
    "/home",
    "/root",
    "/export/blogbackup",
    "/export/dedibackup",
    "/export/git",
    "/export/tm_laptop1",
    "/export/tm_laptop2",
    "/export/tm_laptop3",
  );
 
  return sort @result;
}
 
my @exports = folders();
 
foreach my $export (@exports) {
  my $base = basename $export;
  my $backup = "${backup_to}/$base";
  my $cmd = qq(rclone --transfers 64 -L sync $export $backup);
 
  my $start = strftime "%a %b %e %H:%M:%S %Y", localtime;
  print "$start: start $cmd\n";
 
  system($cmd);
 
  my $stop = strftime "%a %b %e %H:%M:%S %Y", localtime;
  print "$stop: finished.\n\n";
}

and then

for a total of

 

That’s totally within budget.

Published inSmall computers

7 Comments

  1. duply/duplicity also works like a charm with b2.

  2. towo

    Crypto?

    • kris kris

      What exactly is the question here?

Leave a Reply

Your email address will not be published. Required fields are marked *