Going to sleep while duplicati is backuping

My Mac (OS 10.14) enters sleep mode if I don’t touch it while duplicati is making its first backup. Is this expected? I didn’t tick sleep-activate box.
My workaround is to use caffeine to prevent sleep mode.
Thanks

Welcome to the forum @ben80

v2.0.1.27-2.0.1.27_canary_2016-10-14

Added support for “caffeinate” on OSX to prevent sleep during backups

Are you on battery? That might explain it. Does ps show a caffeinate process like above from Duplicati?

Caffeinate prevents my laptop from sleeping is some evidence that it worked, unless it broke somehow.

No i am not on battery, computer is an imac. I should say that I click “lock screen” in the apple menu, as I don’t want colleagues to access my computer while I’m away. I don’t click “sleep” though.

ps -ef | grep caff gives me:
501 16245 3774 0 1:24 ?? 0:00.01 /usr/bin/caffeinate -s

If PID 3774 is Duplicati’s mono process, then it started what it should have. Is that the same caffeinate you run by hand with success, or is yours different? The caffeinate man page that I could read without macOS doesn’t seem to indicate permission restrictions, however I see that it mentions pmset, which has options:

-g assertions Display a summary of power assertions.
Assertions can prevent system sleep or display sleep. 10.6+
-g assertionslog Show a log of assertion creations and releases. 10.6+

which might give some clue about whether Duplicati’s caffeinate -s assertion is even being picked up:

-s Create an assertion to prevent the system from sleeping. This
assertion is valid only when system is running on AC power.

OK, these appear to be two different apps if you really meant “caffeine”, not “caffeinate”, and I don’t know how they interact. Oddly, “caffeine” is said to have had problems on OS 10.14 (Mojave), according to this:

How do I get the Caffeine app working on macOS Mojave?

and the below is suggesting “caffeinate” for your case, but seeing it run on sudo makes me wonder if it’s actually got some permission requirements to it. Regardless, I can’t test it, so you may need to pursue it:

How to make a Macbook Pro lock and not sleep when connected to power?

Thanks for the explanations!
Caffeine is indeed another program than caffeinate. I was not running it in the first place when I used Duplicati, so it should not conflict with caffeinate. I haven’t experienced any problem when using Caffeine on mac OS 10.14. Note that I have also installed duplicati on my macbook pro laptop and there, sleep mode has been prevented during backup. I’ll keep monitoring and playing around with caffeinate