Resource icon

Duplicati Running in an iocage

Mark WatIng

Explorer
Joined
Mar 6, 2017
Messages
53
Mark WatIng submitted a new resource:

Duplicati Running in an iocage - Duplicati Iocage

Hi - I’ve been working on some scripts/commands and now have Duplicati running in iocage as a ‘service’ on my FreeNAS server - Thanks to

He’s what I’ve created (its draft and you will need to modify for your own server).

***** Execute commands ******

#destroy previous iocage
iocage destroy duplicati

#create duplicati iocage
echo ‘{“pkgs”:[“mono”,“py27-sqlite3”,“curl”,“ca_root_nss”]}’ > /tmp/pkg.json
iocage create -n “duplicati” -p /tmp/pkg.json -r 11.1-RELEASE...

Read more about this resource...
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Looks interesting, thanks. You've got a lot of curly quotes in there, which will break things. Also would be helpful to use code tags. Not cmd tags or file tags, code tags.

Also, in the command_args line in the init script, <password> needs to be replaced with the actual password to be used. Otherwise, it seems to be working.
 
Last edited:

Mark WatIng

Explorer
Joined
Mar 6, 2017
Messages
53
Looks interesting, thanks. You've got a lot of curly quotes in there, which will break things. Also would be helpful to use code tags.
Hi made changes with the tags as suggested - re the curly quotes not sure what you mean, but will probably leave as not sure how to remove/simplify - it does work :)
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
it does work
No, it doesn't--you can't copy/paste your (many of) commands and have them work. There are two types of quotes--straight quotes like ' and ", which is what computers have used since pretty much forever, and "pretty" curly quotes that have distinct opening and closing quotes, which are what current GUI word processors often use when you're typing. Your how-to has a mix, but mostly has curly quotes, which FreeBSD doesn't recognize as being quotes. The "echo..." line near the beginning, for example, has curly quotes. The duplicati_data_dir line in the init script has straight quotes. But with those fixed (and the password set in the init script), it does seem to be working. Now to play with it a bit.
 

Mark WatIng

Explorer
Joined
Mar 6, 2017
Messages
53
No, it doesn't--you can't copy/paste your (many of) commands and have them work. There are two types of quotes--straight quotes like ' and ", which is what computers have used since pretty much forever, and "pretty" curly quotes that have distinct opening and closing quotes, which are what current GUI word processors often use when you're typing. Your how-to has a mix, but mostly has curly quotes, which FreeBSD doesn't recognize as being quotes. The "echo..." line near the beginning, for example, has curly quotes. The duplicati_data_dir line in the init script has straight quotes. But with those fixed (and the password set in the init script), it does seem to be working. Now to play with it a bit.
ok I see what you mean, apologies. I did post this on another forum first and then from there to here - something happened during that. Will review and update.

Cheers,
M
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Will review and update.
If you have a text editor that's designed for coding (I use BBEdit on the Mac; Notepad++ is said to be pretty good too and free), there's probably a menu option to fix the quotes (it's called "straighten quotes" in BBEdit). Probably the easiest way to fix it.
 

Mark WatIng

Explorer
Joined
Mar 6, 2017
Messages
53
I use VI - issue was due to a formatting conversion error when I copied the running script from another post I made - updated now should be good.
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Thanks for the instruction. I had one issue that was with creating the rc file. I did that in Nano and got an error like this:
Code:
duplicati not running?
Starting duplicati.
Unmatched '"'.
Unmatched '"'.
/usr/local/etc/rc.d/duplicati: WARNING: failed to start duplicati


After a search on the forum I found someone else had the same as well with Nano. If he created the file with EE it worked well. Tried that and it was solved. So maybe good to add that Nano should not be used to create the rc file.
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Don't know what you mean with curly quotes. But the only thing I did is copy the content for the rc file from the page to Notepad++ and from there to nano. That didn't work. When I did the same with EE instead of Nano it worked. Don't know why that differs just wanted to mention it so other people who run into this can try that approach.

The line which gave the issue is:
. /etc/rc.subr
 

bmac6996

Dabbler
Joined
Sep 11, 2014
Messages
22
Can anyone verify if this works for version 11.3 BETA? I was trying it and I couldn't get the rc.d script to work. It would fail about something was wrong with the "env"
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
I have this running on FreeNAS-11.2-BETA3 but I installed it with an earlier beta version of 11.2 I believe. But it still works on this version at least.
 

bmac6996

Dabbler
Joined
Sep 11, 2014
Messages
22
Actually, I'll add, I got it working.

My biggest issue was the creating the RC file. I did a copy and paste into nano and it added an <enter> rather than <spaces> and the RC config would always fail when trying to start.

So keep that in mind.
 

l4tran

Cadet
Joined
Feb 6, 2018
Messages
8
Newbie question:
"Also, in the command_args line in the init script, <password> needs to be replaced with the actual password to be used. "

I got to http://jail:8200/login.html

What is the password? or how do I change it?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

l4tran

Cadet
Joined
Feb 6, 2018
Messages
8
I tried *useyourpassword*
I also modified --webservice-password=duplicati and restarted
iocage exec duplicati service duplicati restart

when I open up the page, tried duplicati as the password but it gives me Login failed: Unauthorized.
 

l4tran

Cadet
Joined
Feb 6, 2018
Messages
8
I tried *useyourpassword*
I also modified --webservice-password=duplicati and restarted
iocage exec duplicati service duplicati restart

when I open up the page, tried duplicati as the password but it gives me Login failed: Unauthorized.

Had to cleared browser cache. Working. Thanks
 

l4tran

Cadet
Joined
Feb 6, 2018
Messages
8
I'm trying to install Duplicati on another Freenas box but I'm getting this error when creating the jail.


Testing SRV response to FreeBSD
pkg.freebsd.org's SRV record could not be verified.

Testing DNSSEC response to FreeBSD
pkg.freebsd.org could not be reached via DNSSEC.

Testing DNS response to FreeBSD
pkg.freebsd.org could not be reached via DNS, check your network

The jail created successfully but missing all the packages in /tmp/pkg.json

I tried manually to install the package mono using command: iocage exec duplicati pkg install mono

The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly, please wait...
pkg: Error fetching http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly/Latest/pkg.txz: Non-recoverable resolver failure
A pre-built version of pkg could not be found for your system.
Consider changing PACKAGESITE or installing it from ports: 'ports-mgmt/pkg'

I have internet on my freenas box and DNS is working fine.
 

rexit1982

Dabbler
Joined
Oct 30, 2019
Messages
31
I actually started this process a couple days ago....
you should be able to wget https://github.com/rexit1982/iocage-ix-plugins/blob/master/duplicati.json to your freenas base OS
then do something like "iocage fetch -P --name duplicati.json dhcp=on"
and have a working plugin/jail
Then you can add mount points for the datasets/volumes you want to backup. at least that is what I am planning on doing.
I've seen a couple other writeups that put the /config directory outside the jail but I figured if the plex db is good enough to run inside the jail it should be ok for the... but I'e not really used duplicati much yet.

This is very much a v0.01a but it runs and drives at the moment. It looks like I'm coming into plugin making in the middle of a change with 11.3 coming to plugins but hopefully I'm still interested when it hits.
 
Top