Offsite data backup

**NethServer Version: 6.8
**Module: Backup

Our Nethserver installation has been working flawlessly for more than 6 months : not a single problem whatsoever.
A huge improvement from our previous system (SBS Server 2008)!!
It’s funny… I sort of miss rebooting the server after some major updates.

We are currently using Nethserver Backup module to backup our system to a FreeNAS server (HP Microserver Gen 8) exposing an NFS share. This has been working very well, with a weekly full backup and daily incremental save.

I am now planning to implement an off site backup (the FreeNAS system is in the same server room) but I do not want to alter the current backup setup as it is working well.
My first idea was to rsync the whole /var folder to an external USB disk, but it fail once tested it.

Any idea about a possible solution?

P.S. I recently upgraded my home internet connection to a full 100MB fiber, so I may consider to run the backup from home using my VPN access.

Regards

Massimo

@filippo_carletti is the man for this:

3 Likes

I’d rsync /var/lib/nethserver.
Pay attention to format the usb stick using ext3.
You can rsync over ssh to a system in your house, it’s easier than to a usb stick.

2 Likes

I’d work on freenas side, not on the NS one…

Done.
After some initial struggle (the mounted USB disk would interfere with the Backup running at night…) I managed to rsync the whole /var/lib/nethserver.

Very fast and efficient.

Now I have an off-site backup : once a week I bring to the office the disk and I update it; than back home.

Massimo

1 Like

Why not get an ‘unlimited’ cloud backup?


If you make sure your backups are encrypted, you could let the FreeNAS copy the backups to the cloud service.

Rob,
not from China…

Internet connection to foreign websites is too unreliable over here.

Moreover I am quite old fashioned (and old…) : I trust things I can touch … :slight_smile:

Massimo

2 Likes

Hi @maxbet,
If you believe that your question has had a decisive response, marks solved the answer that you have been of help. good work

Done.

In case it may help, here is what I did :

  • Source : the whole /var/lib/nethserver/ folder

  • Destination : external USB HD (2 TB)

The following are my notes on the procedure :

USB DISK PREPARATION (if not formatted yet)

  • Double check the USB disk device name :

    lsblk -io KNAME,TYPE,SIZE,MODEL

  • Create a Linux partition on the whole disk:

    echo “0,” | sfdisk /dev/sdc

  • Create the filesystem on sdc1 partition with a label named “Dalmec” :

    mke2fs -v -t ext3 -T largefile4 -j /dev/sdc1 -L Dalmec

  • Detach and reconnect the USB disk (physically or using the following command):

    blockdev --rereadpt /dev/sdc

DATA BACKUP

  • Create mount point (directory) :

    cd /mnt
    mkdir backup-dalmec

  • Mount USB disk :

    mount -t ext3 /dev/sdc1 /mnt/backup-dalmec

  • Launch backup

    rsync -av /var/lib/nethserver/ /mnt/backup-dalmec/

  • Unmount USB disk (may need to wait for buffers to be flushed):

    umount /mnt/backup-dalmec

  • Check that USB disk has been unmounted :

    mount

One word of warning : if the rsync process runs too long and overlaps with the backup process, the backup will fail. In normal conditions this is not a problem as rsync is quite fast, but it forced me to stagger the first backup in several steps/days.

I hope this may help others

Massimo

3 Likes

@maxbet, thanks for your reply. Great job :wink:

just some feed for thoughts, only rsync the /var/lib/nethserver, might not be enough since some additional modules put a link in /etc/backup-data.d/ to save their data with the backup module.

[root@NS7DEVAllModules ~]# cat /etc/backup-data.d/*
/var/lib/nethserver/backup/duplicity/
/var/lib/nethserver/db
/var/www/bandwidthd/stats.db
/var/lib/nethserver/secrets
/root
/var/lib/nethserver
/var/lib/collectd
/var/spool/hylafax/log/seqf
/var/spool/hylafax/sendq/seqf
/var/spool/hylafax/docq/seqf
/var/spool/hylafax/recvq/seqf
/var/lightsquid
/var/lib/nethserver/webtop/logs
/var/www/html/nextcloud/config/config.php

so if you want a full backup solution, these paths must be saved also.

Therefore a solution like this should be better, supposed that you have a linux client at your home with a port 22 opened in your home firewall

rsync -avzR $(cat /etc/backup-data.d/*) lsd@YourIP:/home/lsd/toto

the -R rsync option save the full path, it will ease your restoration

1 Like

Nice shot! Would you mind writing down some notes for us?

Interesting, did you test one of them with linux?

Not yet, but I did test a provider in .nl that gives 1TB owncloud storage for free. It is accessible directly through webdav, so if you mount the webdav location and do a backup to the mounted webdav directory, you have an offsite backup. In such I case I use duplicity for backup since it can create encrypted backups. I wouldn’t want to store my offsite backups unencrypted.