[筆記] obnam - snapshot tool under CentOS Linux
本文于1394天之前發表,文章內容可能已經過時。
這幾天一直在玩一些備份用的工具,像是rsnapshot / dsnapshot / zfs-auto-snapshot等等
不過都不是很滿意,有的是設定不方便,有的是速度太慢,有的是沒有dedup功能
本來是已經打算就加硬碟,用ZFS當檔案系統來處理
後來看到有這個軟體 obnam
看起來似乎滿強的
官網的介紹如下
Obnam is an easy, secure backup program. Backups can be stored on local hard disks, or online via the SSH SFTP protocol. The backup server, if used, does not require any special software, on top of SSH.
Some features that may interest you:
- Snapshot backups. Every generation looks like a complete snapshot, so you don’t need to care about full versus incremental backups, or rotate real or virtual tapes.
- Data de-duplication, across files, and backup generations. If the backup repository already contains a particular chunk of data, it will be re-used, even if it was in another file in an older backup generation. This way, you don’t need to worry about moving around large files, or modifying them. (However, the current implementation has some limitations: see dedup).
- Encrypted backups, using GnuPG.
吸引我的主要是snapshot / dedup 這兩個
CentOS 6.8 裝了epel-release 之後,就可以看到這個套件,所以安裝是很簡單的
[root@syslog ~]# cat yum.txt |grep obnam
obnam.x86_64 1.8-1.el6 epel
[root@syslog ~]#
接下來,就來測試看看實際執行的狀況
他的指令參數有點多,可以參考官方文件
http://code.liw.fi/obnam/manual/manual.html
首先,在家目錄底下新增一個檔案 .obnam.conf
裡面先寫好備份的來源、目的、LOG檔案等等參數
[root@syslog ~]# cat .obnam.conf
[config]
repository=/zp/backup #備份目的地
log=/var/log/obnam.log #log檔案
root=/var/log,/etc #備份來源
deduplicate=fatalist
kee=30d
[root@syslog ~]#
接著就只要執行 obnam backup 就可以了
還原的方式,是先到備份目的目錄,執行 obnam ls 找到你要的檔案之後
執行
obnam restore –to=/tmp/my_files /backup_files
比如說 我備份了root 目錄,然後我現在要叫回其中一個叫做 abc123的檔案到 /tmp底下
那指令就會是這樣
cd /zp/backup #切換到obnam的備份目錄
obnam ls |grep abc123 #確認一下有沒有這個檔案
obnam restore –to=/tmp/ /root/abc123
這樣就可以了
至於dedup 和 keep 的用法,還要測試驗證一下,尤其是 dedup ,有點難驗證啊…