Running Duplicati beta in Manjaro

Hey there. I recently got involved in Manjaro Linux and I love it thus far. Arch based and all - definitely an active community etc.
I got connected through Octopi and was able to install dupliicati-latest repo from there. I was able to connect to my localhost and all - really slick that way, thank you very much. Little more involved with the install compared to my windows laptop but nothing serious.

Question - Is there a way or a feature I could request that would be able to have a backup initiated when my external drive was connected? Right now I can backup to my NAS or external drive and have it run on a schedule, works fine for my desktop. What about my laptop that roams with me? Is there a mechanism in place that could allow for a backup to be started when x usb device is connected? Or when I am connected again to the mapped drive?

Thanks - Erik

Hey @Erik_Carlin_Technica, welcome to the forum!

At the moment Duplicati is geared towards always available destinations, so there isn’t a built-in feature to “run backup when destination found” (like CrashPlan had).

There are some workarounds that can be done such as:

  • schedule frequent backups with --alternate-destination-marker to abort the backup if the drive is NOT connected
  • schedule frequent backups with a --run-script-before step that checks for the destination and silently aborts if not available
  • use an external tool to detect the USB connect event and trigger a command-line backup execution

Try searching the forum for USB - you may find some other useful items such as:

Thanks for the reply - those solutions seem viable. Are there differences in how the first two commands are interpreted? In regards to stability or reliability? I am leaning towards the first one and will look at that post you linked.

Any feature request landing page etc that we might be able to request something similar? For now I’ll look at this and see what I can make work - appreciate the info and your speedy reply.

Going through the settings on the GUI I found --alternate-destination-marker and will leave it at the default, that should stop the job if my usb device is not plugged in then. Is that correct? Sorry for the clarification.

The default --alternate-destination-marker value is an empty string (meaning don’t look for a marker). In your case I think you’d want to put something in there (like maybe “MyDuplicatiUSB.txt”) then create a file with that name on your USB drive.

The drawback of using that method is that I think the job give a warning message every time it does NOT find the destination - so if you run it every 10 min. you get 6 notifications an hour…ouch!

The nice thing about the --run-script-before option is that Duplicati recently added support for silently aborting a backup based on the return code from the script so you don’t get all the “destination not found” warnings.

That makes sense. Thanks for the clarification.

I didn’t see the run script before command or option in the gui interface. I apologize, perhaps I am not looking in the right area but I am looking where I found the alternate destination command.

Is this only available via the command line? I’m not at a pc I’ll Google later and check again.

Appreciate your patience and info.

I think I might have got it - I can put this one liner in and make it work - not using the drop down, is that the idea? See attached screenshot.

Try going to step 5 (Options) and looking in “Add advanced option” near the bottom of the page - it should be about 2/3 of the way down. (Sorry - I can’t do a screenshot right now.)

Nice work - found it. So those settings go at the end of the config then, not at the beginning. Kind of makes sense. I filled it out with the run script before command and went back in to confirm. It auto-populated the field/box with TRUE. See screenshots. So that should do it then.

I assume you have to put the link to the script you want to run there. Search the forum for examples, pretty sure there are some.

1 Like

Yes, @Wim_Jansen is correct - now you write the script you want to run to do the “is the USB drive connected?” check and have that script spit out the correct return code to tell Duplicati whether to continue with the backup, abort with notification, or abort silently.

I know - it’s not as simple as we’d like, we just haven’t gotten there yet. :slight_smile:

If I get some time I’ll try to post a sample windows batch file Until then, if you really feel like reading more on this, here’s an older topic that I think covered the subject fairly well.

Ah, OK. Yeah if you have time that would be awesome.
Is this where I tell you that I’m on Manjaro linux? :stuck_out_tongue: hah. Anyways, it’s not a huge concern. The fact that I was able to install duplicati through a package in the arch repo - that’s huge. It’s a nicety, not a critical thing.

Very happy thus far, for my laptops anyways it almost seems best for Backblaze over the internet but the home machines to my NAS - and that doesn’t need a trigger as such.

Let me know if you have further insight on linux specific - I thought about rolling a Manjaro built laptop so tat would be wicked to get going with a usb key input too down the road. However, thanks for the information ten fold.

Oops - got my topics mixed up. :blush:

I can provide a basic Linux shell script but for mount detection we’ll probably have to grab somebody like @Pectojin.

Does the drive have a static mount point? If so it might be as simple as “if /mnt/USB/Duplicating UPS/ folder found return 0 else return 3” (or something like that).

Alright that would be cool to get going anyway.

What does duplicati use for it’s back end for backups? I know a lot of these backup utilities use rsync, etc for the backup mechanism, quick google didn’t come up with much. Quite enjoying my experience thus far with it - thanks muchly.

If you haven’t ready it yet, you may find the How the backup process works • Duplicati page useful but a quick summary is that Duplicati just uses normal GET, PUT, LIST, and DELETE features of the destination.

It basically assumes a “dumb” backend and handles everything on the Duplicati executing side. This makes it easy to support many different types of backends since the GET/PUT/LIST/DELETE support bar is pretty low. :slight_smile:

I have read the document briefly trying to skim through to find what I was looking for - but that’s awesome. With so many different options there definitely is a learning curve to a lot of them but Duplicati makes it pretty brain dead simple.

On my windows machine - I get these errors. Any thoughts?

Nov 27, 2018 9:59 AM: Request for http://localhost:8200/api/v1/backup/40873d6b-e67c-4e0f-ad41-0aaa1013fe8d/log?pagesize=100 gave error
Nov 27, 2018 9:59 AM: Reporting error gave error
Nov 27, 2018 9:57 AM: Failed while executing “List” with id: 40873d6b-e67c-4e0f-ad41-0aaa1013fe8d
Nov 27, 2018 9:57 AM: Request for http://localhost:8200/api/v1/backup/40873d6b-e67c-4e0f-ad41-0aaa1013fe8d/filesets gave error
Duplicati.Library.Interface.UserInformationException: No filesets found on remote target
at Duplicati.Library.Main.Operation.ListFilesHandler.Run(IEnumerable1 filterstrings, IFilter compositefilter) at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action1 method)
at Duplicati.Library.Main.Controller.List(IEnumerable`1 filterstrings, IFilter filter)
at Duplicati.Server.Runner.Run(IRunnerData data, Boolean fromQueue)
at Duplicati.Server.WebServer.RESTMethods.Backup.ListFileSets(IBackup backup, RequestInfo info)
at Duplicati.Server.WebServer.RESTHandler.DoProcess(RequestInfo info, String method, String module, String key)
Nov 27, 2018 9:57 AM: Reporting error gave error
System.ObjectDisposedException: Cannot write to a closed TextWriter.
at System.IO.__Error.WriterClosed()
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at Duplicati.Server.WebServer.RESTHandler.DoProcess(RequestInfo info, String method, String module, String key)

I fixed my issue. There was another folder in my destination for the backup. It was “F:\backup” but it changed to “f:\backup.rs something” not sure. Maybe I hit some buttons by mistake - backup worked.

Just to clarify, you mean your Windows backup worked and you’re still working (waiting) on a “run when USB drive found” solution for Manjaro, right?

Yep, sure am. I installed on both machines and was able to fix my Windows error.