Running duplicati 2.x on rockstor

After getting fedup with NFS being a bit flakey on my box when used between VM’s (Still not got the bottom of that) i’ve decided to move duplicati onto Rockstor itself

Running this directly on the server itself rather than as a Rock-on because quite honestly it’s going to need access to the filesystem to do it’s job properly anyway (It’s backup software after all)

It’s actually fairly simple

Head over to http://www.mono-project.com/docs/getting-started/install/linux/ and follow the instructions for centos 7
Install mono-complete.

then head over to http://www.duplicati.com/ and grab the v2 preview

Unzip the file to a directory of your choice, I used /backup for simplicty sake.

CD into the backup directory and run mono ./Duplicati.Server.exe --webservice-interface *

login to the web interface on http://rockstorip:8200

Goto options and make sure allow remote access is ticked, set a password if you wish. (once done we will not need the --webservice-interface * in the future, this is needed as by default it will only allow access from the server itself which s a bit useless in rockstors case as it doesn’t have a local web-browser)

I’d suggest running duplicati server in screen in the future to stop it closing when you ssh out.

Now I just need to figure out a startup script, I usually use rc.local but I think rockstor overwrites it on reboot as the command i put in there seems to have vanished @suman can you confirm?

2 Likes

Rockstor doesn’t touch rc.local anymore. It uses systemd exclusively, which is recommended. I suggest you create a simple unit file that starts after rockstor-bootstrap. Look at /etc/systemd/system/smb.service or rockstor files for reference

This seems to have worked

/etc/systemd/system/duplicati.service

[Unit]
Description=Duplicati Backup software
After=rockstor.service

[Service]
ExecStart=/usr/bin/mono /backup/Duplicati.Server.exe

[Install]
WantedBy=multi-user.target

systemctl enable duplicati.service
service duplicati start
service duplicati status

Redirecting to /bin/systemctl status duplicati.service
duplicati.service - Duplicati Backup software
Loaded: loaded (/etc/systemd/system/duplicati.service; enabled)
Active: active (running) since Tue 2015-12-01 17:00:29 GMT; 2min 54s ago
Main PID: 5880 (mono)
CGroup: /system.slice/duplicati.service
└─5880 /usr/bin/mono /backup/Duplicati.Server.exe

Dec 01 17:00:29 BN-NAS1 systemd[1]: Started Duplicati Backup software.

1 Like

I suggest changing this to
After=rockstor-bootstrap.service
Requires=rockstor-bootstrap.service

to ensure that (1) duplicati starts after rockstor-bootstrap and (2) only if it succeeds/activates. You need rockstor-bootstrap because that’s what ensures your Shares are properly mounted etc…

It may be worth reading the documentation to see if there are better ways to do it.

Hmm might do that but in reality it’s not that critical

  1. My duplicati is set never to do anything for the first 5 mins after startup which means rockstor would have plenty of time to mount the shares anyway

  2. Worst case if the share hadn’t mounted i’d backup an empty directory. I think even on the backup job where I set the shortest retention period it’s still set at least several weeks if not months. (I.e the backup DIR not mounting won’t cause me to lose data unless i let it go unnoticed for a very long time)

Revised config

Implemented auto restart as well as Duplicati does occasionally die when working with large data, particularly if memory is low.

[Unit]
Description=Duplicati Backup software
After=rockstor-bootstrap.service
Requires=rockstor-bootstrap.service


[Service]
ExecStart=/usr/bin/mono /backup/Duplicati.Server.exe
Restart=on-failure
RestartSec=30

[Install]
WantedBy=multi-user.target
1 Like

This thread has been very helpful.

Forgive me for being a noob here, but what do you do with this command? Where do I save it/how do I ensure that it is run on boot?

I may give duplicati a try over the holidays as I’ve only ever heard good things about it.

Save the file in /etc/systemd/system/duplicati.service

then type

systemctl enable duplicati.service
service duplicati start
service duplicati status

Redirecting to /bin/systemct

The script assumes you have Duplicati 2.x and it’s installed in /backup, you can however put it wherever you want just change the ExecStart line to point in the right place…

Don’t forget to run Duplicati manually the first time (Follow instructions in first post) as otherwise it will default to binding to localhost which isn’t a lot of use for most people since rockstor doesn’t out of the box have a graphical webbrowser and therefore you won’t be able to get to the WebUI.

Thanks for the instructions, they worked very well.
The standard /tmp on Rockstor was too small for me, so I changed the script for me:

[Unit]
Description=Duplicati Backup software
After=rockstor-bootstrap.service
Requires=rockstor-bootstrap.service

[Service]
ExecStart=/usr/bin/mono /backup/Duplicati.Server.exe
Restart=on-failure
RestartSec=30
Environment=TMPDIR=/alternative/tmp/dir

[Install]
WantedBy=multi-user.target

1 Like

is it possible to implement this as a default backup solution (service) in Rockstor?

Duplicati does support most of the online backup providers out there, along with local backup support if needed.

@bug11 My concern with integrating / relying on duplicati is:
1 - it’s dependancy on .NET or Mono
2 - it doesn’t appear to be that actively developed, last stable was 2013 !! but 2.0 coming apparently (2016)
(2 updates to dev release in 2015-16 from web page news)
3 - has it’s own “duplicity inspired!” protocol.

Does look active on GitHub though.

I think a better bet for Rockstor integration would be something that used a well known and multi program supported protocol / lower level program such as duplicity itself, or actively maintained wrappers such as duplicity-backup GPLv3. That way one would always have duplicity compatible archives and all the freedoms that come with that.

I would vote duplicati server mode as more of a Rock-on than something to build in proper.

Just my opinion though.

I thought duplicati use to be windows only when I last saw it, has it always been open-source and cross platform?

Thanks for this thread everyone, I found it pretty useful having never heard of Duplicati before.

I have created an issue for this on our github tracker. Did a quick search on docker hub and there are a few images available. It would be nice if we can do implement this as a Rock-on, though I am not against supporting it natively. A few questions for you Duplicati and Rockstor users out there.

  1. What are the advantages of supporting it natively versus as a Rock-on?

  2. Where does it store metadata? in the installed location(/backup for example) ?

2 Likes

Duplicati Rock-on completed, in my 3rd party thread