Obnam n'est plus maintenu : https://blog.liw.fi/posts/2017/08/13/retiring_obnam/ !!!
⇒ Migration à faire vers Borg
TO DO
Je vais suivre le tutoriel sur le site d'obnam.org. On commence par installer, dans mon cas sur Debian8 - Jessie :
# apt-get install obnam
On peut faire un fichier de configuration, il est optionnel mais permet de ne pas retaper tous les arguments à chaque fois.
# vim ~/.obnam.conf # cat ~/.obnam.conf [config] repository = /mnt/bkp/ log = /var/log/obnam.log
On peut sauvegarder tout le home d'un utilisateur, par exemple :
# obnam backup --repository="/mnt/bkp/" /home/simon/ Backed up 14245 files (of 14245 found), uploaded 218.0 MiB in 1h11m11s at 52.4 KiB/s average speed
(Le dossier /mnt/bkp/ est un montage via sshfs, ça ralenti le backup!)
# cd /mnt/bkp/ /mnt/bkp# obnam generations 2 2017-02-19 18:19:12 .. 2017-02-19 19:29:43 (14245 files, 236801863 bytes)
On peut lancer un autre backup sans rien changer, juste pour voir. Ça va très vite!
# obnam backup --repository="/mnt/bkp/" /home/simon/ Backed up 0 files (of 14245 found), uploaded 0.0 B in 56s at 0.0 B/s average speed
Si on rajoute un/des fichier(s), et qu'on relance un backup :
# obnam backup --repository="/mnt/bkp/" /home/simon/ Backed up 2 files (of 14246 found), uploaded 0.0 B in 51s at 0.0 B/s average speed
On voit qu'on a plusieurs “générations” :
/mnt/bkp# obnam generations 2 2017-02-19 18:19:12 .. 2017-02-19 19:29:43 (14245 files, 236801863 bytes) 36 2017-02-19 20:16:22 .. 2017-02-19 20:16:39 (14245 files, 236801863 bytes) 70 2017-02-19 20:18:11 .. 2017-02-19 20:18:24 (14246 files, 236801863 bytes)
# obnam backup --repository="/mnt/bkp/" /var/www/ Backed up 48803 files (of 48803 found), uploaded 311.0 MiB in 4h21m3s at 20.3 KiB/s average speed # ls -al /mnt/bkp/ total 32 drwxrwxr-x 1 549 549 4096 Feb 20 08:29 . drwxr-xr-x 3 root root 4096 Feb 19 18:11 .. drwx------ 1 549 549 4096 Feb 20 12:50 114327624274822128 drwx------ 1 549 549 4096 Feb 20 12:50 chunklist drwx------ 1 549 549 4096 Feb 20 12:50 chunks drwx------ 1 549 549 4096 Feb 20 12:50 chunksums drwx------ 1 549 549 4096 Feb 20 08:29 clientlist drwx------ 1 549 549 4096 Feb 20 08:29 metadata # obnam backup --repository="/mnt/bkp/" /var/www/ Backed up 277 files (of 48987 found), uploaded 974.0 KiB in 4m31s at 3.6 KiB/s average speed
On peut créer un alias dans /root/.bashrc :
alias backup='obnam backup /home/mon-user/ /var/ /etc/ /autre/dossier/'
TO DO
TO DO
root@Marvin:/home/simon# mkdir /tmp/backups root@Marvin:/home/simon# obnam mount --to /tmp/backups root@Marvin:/home/simon# ls -al /tmp/backups/ total 28 drwxr-xr-x 22 root root 4096 Jul 2 13:19 . drwxrwxrwt 10 root root 4096 Jul 4 09:46 .. drwxr-xr-x 22 root root 4096 Jun 29 19:13 23750 drwxr-xr-x 22 root root 4096 Jun 29 21:33 23830 drwxr-xr-x 22 root root 4096 Jul 2 13:19 24357 lrwxr-xr-x 22 root root 4096 Jul 2 13:19 latest -> 24357 -r--r--r-- 22 root root 4096 Jul 2 13:19 .pid
sources : https://nos-oignons.net/wiki-admin/Proc%C3%A9dures/Manipuler_les_sauvegardes/
# backup 00h00m06s 1 files 0 B scanned: locking clientERROR: R681AEX: Couldn't create lock 114327624274822128/lock: timeout
$ man obnam (...) · force-lock removes a lock file for a client in the repository. You should only force a lock if you are sure no-one is ac‐ cessing that client's data in the repository. A dangling lock might happen, for example, if obnam loses its network connec‐ tion to the backup repository. (...)
# obnam force-lock # backup # backup 00h00m12s 1 files 0 B scanned: starting new generation (...)