Backup

February 14, 2019

duplicati

duplicati 是一個開源的備份軟體,可用在 cloud storage 服務或者 file serverduplicati 可工作於 WebDAVGoogle Cloud DriveMEGA…等等。

最近會使用原因,因為社群有人寫文章分享,我有時也會備份資料去雲端但大多數是開著雲端網頁拉某資料夾的檔案到網頁。因為那篇文章我就嘗試運用 duplicati 做定期備份,這樣減少了我的干預。Duplicati 也提供強大的加密功能,同時備份檔案放在公共網路服務器上比在家中未加密的文件更安全。

Install

以 ubuntu 為主機安裝 duplicati 此軟體。載點

$ wget https://updates.duplicati.com/beta/duplicati_2.0.4.5-1_all.deb
$ sudo dpkg -i duplicati_2.0.4.5-1_all.deb
(Reading database ... 99829 files and directories currently installed.)
Preparing to unpack duplicati_2.0.4.5-1_all.deb ...
Unpacking duplicati (2.0.4.5-1) over (2.0.4.5-1) ...
dpkg: dependency problems prevent configuration of duplicati:
 duplicati depends on mono-runtime (>= 3.0); however:
  Package mono-runtime is not installed.
 duplicati depends on libmono-2.0-1; however:
  Package libmono-2.0-1 is not installed.
 duplicati depends on libmono-system-core4.0-cil; however:
  Package libmono-system-core4.0-cil is not installed.
 duplicati depends on libmono-system-configuration4.0-cil; however:
  Package libmono-system-configuration4.0-cil is not installed.
 duplicati depends on libmono-system-configuration-install4.0-cil; however:
  Package libmono-system-configuration-install4.0-cil is not installed.
 duplicati depends on libmono-system-data4.0-cil; however:
  Package libmono-system-data4.0-cil is not installed.
 duplicati depends on libmono-system-drawing4.0-cil; however:
  Package libmono-system-drawing4.0-cil is not installed.
 duplicati depends on libmono-system-net4.0-cil; however:
  Package libmono-system-net4.0-cil is not installed.
 duplicati depends on libmono-system-net-htt
dpkg: error processing package duplicati (--install):
 dependency problems - leaving unconfigured
Processing triggers for mime-support (3.59ubuntu1) ...
Errors were encountered while processing:
 duplicati

在使用 dpkg 安裝時出現 Error。這 Error 要求要一些依賴軟體

$ sudo apt-get install -f

利用下面指令確認

$ sudo dpkg -l duplicati
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                           Version                      Architecture                 Description
+++-==============================================-============================-============================-=================================================================================================
ii  duplicati                                      2.0.4.5-1                    all                          Backup client for encrypted online backups

Start service

$ sudo systemctl start duplicati.service
lab702@elk:~$  systemctl status duplicati
● duplicati.service - Duplicati web-server
   Loaded: loaded (/lib/systemd/system/duplicati.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-02-13 13:12:28 CST; 25s ago
 Main PID: 74617 (mono)
    Tasks: 17
   Memory: 30.6M
      CPU: 742ms
   CGroup: /system.slice/duplicati.service
           ├─74617 DuplicatiServer /usr/lib/duplicati/Duplicati.Server.exe
           └─74628 /usr/bin/mono-sgen /usr/lib/duplicati/Duplicati.Server.exe

Feb 13 13:12:28 elk systemd[1]: Started Duplicati web-server.
lab702@elk:~$ sudo systemctl enable duplicati.service
Created symlink from /etc/systemd/system/multi-user.target.wants/duplicati.service to /lib/systemd/system/duplicati.service.

Defaul port

duplicati 預設 port 為 8200

$ netstat -ltn | grep 8200
tcp        0      0 127.0.0.1:8200          0.0.0.0:*               LISTEN

Start duplicati

可用以下兩種方式啟動 1.

$ duplicati


(Duplicati.GUI.TrayIcon:97053): libappindicator-WARNING **: Unable to get the session bus: Failed to execute child process "dbus-launch" (No such file or directory)

(Duplicati.GUI.TrayIcon:97053): LIBDBUSMENU-GLIB-WARNING **: Unable to get session bus: Failed to execute child process "dbus-launch" (No such file or directory)

$ sudo duplicati-server --webservice-interface=192.168.222.128
$ sudo duplicati-server --webservice-interface=192.168.222.128 & # 背景執行

192.168.222.128 為 Host IP address

Remove duplicati

$ sudo dpkg -r duplicati

Duplicati backup data to google drive

  1. 點選 AuthID 登入 google 服務即可獲得 AuthID

  2. 勾選要備份到雲端的資料

  1. 首頁會出現剛設定的 backup

  2. 查看雲端

其中在第二步驟輸入的密碼是在還原時,要用到的。

Data restore

  1. 輸入當備份時所加密的密碼

  2. 會列出當時您備份的資料,將要還原的資料打勾

  3. 設定還原時選項,依照個人需求設定

  1. 成功畫面

Conclusion

我是在 windows 上使用 duplicati 做備份,duplicati 可以幫備份資料做加密提高了安全性,又可以上傳至 cloud 可達成異地備份的任務,是一個很不錯的開原軟體。但有很多功能還在摸索,因此此文章只是描述我如何備份至雲端。

我在學校有管理系統,因此正在研究如何將系統的備份資料透過 duplicati 上傳至 NAS。這部分我成功後會修補文章。

Reference

github

install-duplicati-ubuntu-server

jasoncheng