Autostarting for multiple users on Linux

Other than having an icon in the notification area, is there any difference between starting duplicati via the duplicati command versus the duplicati-server command?

I’m looking to have duplicati automatically start for each user when they log into Linux (openSUSE Leap 15), so I need to know which command to use.

Also, how do I set the port number that each duplicati instance uses when started? I see from the manual that each new invocation sets a different port number. But since users can log in in different sequences, each user would essentially have a random port number by default.

So I need to explicitly set a per-user port number when starting each duplicati instance, so that if a particular user wants to connect to their instance, they would have a known, fixed port number to go to.

Sorry if these are basic questions, but my (admittedly limited) reading of the online manual has left me in the dark on these topics.

Thanks for the help!

Running Duplicati as a deamon / service as root will create instance which would have access to all users folders (so as to be able to back them up). If you don’t want individual users to be able to see backup jobs for other users then you probably don’t want to use this.

Running as the tray-icon works as you described - it only starts (so only backs things up) when the user is logged in (which I would assume is OK as it’s unlike their files would be changing if they weren’t logged in).

If you want to give each user their own hard coded port then you’d need to add --webservice-port to the startup shortcut for each user (or put it in a parameters file as described here).

I don’t know if it matters to you or not but unless each user has their own GUI password set up they will be able to connect to the ports of other users and see their backup jobs.


For further reference, here are all the Tray-Icon related parameters.

Thanks for the reply.

I’m still unclear on what the different is - other than starting the tray icon - between the duplicati command versus the duplicati-server command.

You are correct in that I’m not concerned about user file changes taking place when they are not logged in, so having one instance of one of the above commands run for each user as they log in is OK. Running an instance as root - with access to all files on the system - is definitely not the way I want to go.

Duplicati’s main functionality happens in the “server” code. Duplicati.Server.exe starts a server listening on the first unused port it can find (starting at 8200, then checking 8300, 8400, 8500, etc.). This is all that’s needed for Duplicati to run - the web GUI can be accessed from the web browser at localhost:8200 (or 8300, 8400, etc.) and backups will run whether the web browser is open or not.

When running Duplicati.GUI.TrayIcon.exe it will put an icon in the tray so you can easily see the status of Duplicati as well as provide easy access to the GUI. By default it will ALSO will start up its own server, again running on the first unused port it can find.

By adding the --no-hosted-server parameter you can tell the tray icon to not start it’s own server, in which case it will try to attach to the first Duplicati used port it can find.

By adding --hosturl you can force as specific port to use (if NOT using --no-hosted-server) or which one to attach to (if USING `–no-hosted-server).

Thanks for the explanation.

From what you’ve told me, the easiest way to deal with multiple users on a system using duplicati is to have each user autostart /usr/bin/duplicati. This will automatically give each user a server on a unique port. The users won’t need to know their (possibly changing depending who logs in first) port number, since the tray icon will automatically open a browser window connected to the right server.

One final question: If duplicati is running a job (backup or restore being of primary concern) when a Linux user logs out, what happens? Has the server isolated itself so that it doesn’t get killed, or is the current operation suddenly interrupted? If the latter, particularly if a file has been partially uploaded or partially downloaded, what happens when duplicati next runs?

Thank you again for your help.

While that is correct, you should note that if a user decides to create a browser bookmark to use instead of the tray icon then it’s possible it will point to an incorrect port in the future.

I believe it’s interrupted, but in a way so that when next run Duplicati will pick up where it left off. If partial files have been written they should get cleaned up when the next backup starts.

It is indeed aborted when a user logs out. This is particularly troubling during a restore, since it is not atomic, does not resume, and can leave incomplete files behind.

In another thread this was discussed with the solution of running the server on a per user basis using a Linux service template file. (Slightly unfinished as of now, since there needs to be a customization of port number by user name, but a final service file will be posted there once written and tested.)

Thanks for the help!

Oops, you’re right. Sometimes it’s hard to get out of the “everything is a backup” mindset. :blush:

Indeed, pretty much anything NOT a backup is not atomic. So restores, database repairs / recreates, test / verify, etc. will NOT “just continue” on restarting after an interruption.