I’m looking to put together a how-to for shifting a Mac installation of Duplicati to a service, but the only stuff I’m finding (such as Running as a Service on Mac is so old it doesn’t work with current versions of MacOS…
Unfortunately, I’m not super familiar with Macs either so I’m not sure how to build a current OS version supported .plist file to send to launchctrl (or even if such as thing is needed) - but I am willing to play around with stuff!
So if anybody has any suggestions on how to get Duplicati going as a service on more recent MacOS versions, please share - I’ll test and post it here (unless you want to do it yourself).
Warning: I have not tested either of these plists yet and won’t be able to for few more hours .
Try placing this plist in /Library/LauncDaemons/. Then either reboot or run sudo launchctl load -w /Library/LaunchAgents/net.duplicati.server.plist. This should start the server as root and make it accessible from the usual URL.
For the Tray Icon, you’ll need this plist in either /Library/LaunchAgents to run when any user logs in or ~/Library/LaunchAgents/ to run when only a specific user logs in. You may need to change this line:
I guess using open should take care of mono’s path. Although it seems I still need to pass --hosturl="http://localhost:8200" --no-hosted-server for it to work. I have updated net.duplicati.tray-icon.plist accordingly.
I found the service plist to work quite well, though in an unrelated issue I’m having permission issues between user accounts.
I didn’t have time to test the tray icon. Note that your “always error” icon might be related to a known install issue that is resolved by forcing an error (and subsequent icon reset) such as by starting then canceling a backup.
I understand this behaviour when multiple users are each running their own Duplicati service + tray icon; but I wonder why this would happen when there is only a single instance of the service running as the root?
I’m having similar issues. I have the two .plist files in /Library/LaunchAgents and /Library/LaunchDaemons; both specify port 8200 and the tray-icon one specifies no-hosted-server.
However somehow I’ve ended up with my config using 8300, so when I start my system from scratch, neither localhost:8200 nor opening from the menu shows my config. I have to quit the menu and reopen Duplicati from /Applications (to launch on 8300) to see my config.
I’d have to test but I think the issue might be that you are telling the tray-icon one (is that LaunchAgents?) both a port number (which says “use this port for your server”) AND --no-hosted-server (which says “don’t host your own server”) so it’s getting conflicting parameters.
I suspect if you quit the tray-icon (right click on it and select Quit) port 8300 will stop working but port 8200 will continue to load. This means that the daemon/service is loading first (and taking port 8200) then the tray-icon is loading TRIES for port 8200 but sees it’s in use so moves on to port 8300.
Unless you’ve already got a big backup created or a lot of jobs configured, the easiest way to shift from port 8300 (tray-icon) to port 8200 (daemon/service) is probably to export the job from one then import into the other.
I’d then suggest renaming the port 8300 job to something like “DO NOT USE” or “WRONG PORT!” - that way if this happened again you’d have a visual notice of what was going on rather than “crap, all my configs disappeared!”. If you do decide to delete the 8300 job (after confirming it works at port 8200) make sure to only delete the config. You can delete the database only if you didn’t point the port 8200 job to the old port 8300 .sqlite file. (If you do delete the database, that’s OK - it can be recreated, but it takes a while for Duplciati to chunk through every thing.
Unless you’re planning to start your backups from scratch, whatever you do, DO NOT delete the destination files as this is your already backed up content. If you delete that there’s no recovering it - you’ll just have to start your backups from the beginning again.
You’re exactly right in your analysis; I tried to export my config from 8300 to 8200 but this caused problems with some of my source file paths.
However, I realise I was over-complicating things for myself. I have removed both plist files and have simply added Duplicati.app to my login items. I only have one user on this machine so this works well enough for me.
Slight disadvantage though is that this causes the browser to open at http://localhost:8200/ on login but I can live with that (perhaps an option to control this could be included in a future release).
Hope I can jump in this thread as I’m having a similar issue. If you want, I can create a new thread if that is better…
Summary of my issue:
I created the 2 plists per above and put them in the appropriate directories
When I start up, the icon has a X in it
If I select open on the open, it opens a web page (8200) but it doesn’t have any backup sets in it
If I try launching the app, nothing happens
If I try going to 8300 it can’t find anything
I originally just added the app to my start up items, but like the others, it launches the web browser upon log in. I made sure ‘reopen windows at login’ in not selected, and I even quit safari prior to logging out.
Any ideas? I assume this is working successfully for someone.
This may not apply to you, but it is a known scenario for the icon to show the “X” if no jobs have been run yet.
What backups are you expecting to see? Did you already create some that “disappeared” when you shifted to service installation?
What “app” are you trying to open? Other than the GUI (which is the tray icon / web interface) things are pretty much all command line, so it’s possible the shell is opening, showing an error message or help screen then closing again before you can see it.
Port 8300 should only come into play if you’re running more than one instance of Duplicati, such as the service and self-serving try icon or perhaps a self-serving tray icon in two different user logins.