Backup-data-cloud

I hacked the backup-data script to add a second destination to store the backup remotely.
The standard backup stores a full backup every Sunday on a local hard disk attached to an usb port, then make incremental backups every day.
I added an always incremental backup to a remote linux server over ssh (no bandwidth to make a full backup).
Now, every night, when backup-data runs, it will write to the usb disk first and then to the remote server. If one of the two backups fail, it notifies me with the standard email.
Before adding my script, I copied the last full backup I had on the hard disk (I drove to the linux server location).
I have the script and some notes, Iā€™d like to support some volunteer whoā€™d like to write a complete howto.

4 Likes

Hi @filippo_carletti

Iā€™ have a server test configurated with backup on an nfs share.
It might be fine for testing your script?

If so, I might use it as battlefield for writing the howto :slight_smile:

Let me know :slight_smile:

You need a ā€œremoteā€ server where you can write files using ssh/sftp. My remote is a NethServer.
The cloud backup tool/format is duplicity like the standard backup, so I used a full backup I had to ā€œseedā€ the remote location.
Steps:

  1. copy backup to usb disk
  2. drive to remote and cp backup to local hard disk
  3. add cloud backup scirpt

Steps 1 and 2 can be omitted but the time for the first full backup can be long

While looking at my notes, after having evaluated obnam and attic, I feel that duplicity is not the right tool for this kind of backup and this configuration is complex and error-prone.

Iā€™ll send you the script and listen to your comments, but I think I will abandon this project in favor of attic.

Download this archive to nethserver:

wget http://nethservice.nethesis.it/cloud-backup-duplicity.tar.gz

Extract:

tar -zxvf cloud-backup-duplicity.tar.gz -C /

Configure the script:

config set backup-data-cloud configuration status enabled TargetUrl 'sftp://root@remoteserver.example.org:2222//mnt/backup/remotepath'

remotepath cound be empty or initialized with a full backup
If you start from a full backup this command checks you can read it:

duplicity collection-status --archive-dir /var/lib/nethserver/backup/duplicity $(config getprop backup-data-cloud TargetUrl)

One question

If Iā€™ve a password authentication I should configure it in the TargetUrl? Itā€™s the right way?

config set backup-data-cloud configuration status enabled TargetUrl 'sftp://root:password@remoteserver.example.org:2222//mnt/backup/remotepath'

I use ssh keys to authenticate:

ssh-copy-id "filippo@remote.example.org -p 2222"

Using root is not a best practice. :grinning:

I agree with youā€¦ I will integrete the how to with this step :slight_smile:

Anyway Iā€™ve a problem running the last command

Seems that dublicity doesnā€™t found the full backup to copy in the cloud

This is the log.

[root@nthsrv ~]# duplicity collection-status --archive-dir /var/lib/nethserver/backup/duplicity $(config getprop backup-data-cloud TargetUrl)
Import of duplicity.backends.dpbxbackend Failed: No module named dropbox
I metadati locali e remoti sono sincronizzati, non ĆØ necessario sincronizzare nuovamente.
Data dell'ultimo backup completo: nessuna
Stato collezione
-----------------
Connessione con il backend: SSHParamikoBackend
Directory di archiviazione: /var/lib/nethserver/backup/duplicity/5b74d838689d5671d131e2a2591e2ae9

Found 0 secondary backup chains.
Non ĆØ stata trovata alcuna catena di backup con firme attive
Non sono stati trovati set di backup orfani o incompleti.

A full backup is made every day (the test machine hasnā€™t much data to copy) so I think it is present.

Have you any ideas to where to watch?

No idea, sorry. You could try to add -v8 for verbose output.
For reference, output here:

 # duplicity collection-status --archive-dir /var/lib/nethserver/backup/duplicity $(config getprop backup-data-cloud TargetUrl)
Import of duplicity.backends.dpbxbackend Failed: No module named dropbox
I metadati locali e remoti sono sincronizzati, non ĆØ necessario sincronizzare nuovamente.
Data dell'ultimo backup completo: Sun Jan 18 01:04:00 2015
Stato collezione
-----------------
Connessione con il backend: SSHParamikoBackend
Directory di archiviazione: /var/lib/nethserver/backup/duplicity/b5369d4d4dab7c47fc7764e5dd010194

Found 0 secondary backup chains.

Trovata catena di backup primaria con catena di firma corrispondente:
-------------------------
Data di inizio della catena: Sun Jan 18 01:04:00 2015
Data di fine della catena: Tue Jun  9 01:16:22 2015
Numero dei set di backup contenuti: 132
Numero totale dei volumi contenuti: 545
Tipo del set di backup:                            Data:   Numero di volumi:
            Completo         Sun Jan 18 01:04:00 2015               376
        Incrementale         Mon Jan 26 01:20:42 2015                 6
        Incrementale         Tue Jan 27 01:23:09 2015                 2
        Incrementale         Wed Jan 28 01:24:13 2015                 5
        Incrementale         Thu Jan 29 01:21:45 2015                 1
        Incrementale         Sat Jan 31 01:22:33 2015                 1

After some days and unsuccessful tests, I confirm that your feel is correct.

Duplicity is a little bit tough and I think that should be improductive to go overā€¦
I trust in your instinct and Iā€™ll wait your indication to take the field with an how to on attic. :smile:

Did you agree with me that we might strike off the item from @alefattorini list? :wink:

3 posts were split to a new topic: Canā€™t start backup-data-cloud

A post was merged into an existing topic: Canā€™t start backup-data-cloud