Page 1 of 1

Issue shutdown command when all jobs completed.

Posted: Mon Jan 22, 2024 1:37 pm
by JDG
I have several profiles scheduled to run daily for backups. Is it possible for Syncovery to issue a shutdown command when the FINAL job has completed?

In effect I want the linux box to wake up (it does this) run my Syncovery profiles and then close down when they have finished. I'm not certain which job will the last one to complete, however as the amount of files to backup will vary.

John

Re: Issue shutdown command when all jobs completed.

Posted: Mon Jan 22, 2024 2:35 pm
by tobias
Hello,
thanks for the idea! It might be possible with some scripting tricks but would be much easier if I added it as a native feature, or at least enable the PascalScript language to do this easily.

Which CPU type does your Linux box have? I ask because PascalScript is currently not available on ARM64 (aarch64).

Re: Issue shutdown command when all jobs completed.

Posted: Mon Jan 22, 2024 3:05 pm
by JDG
It's x64 :)

Thinking about it, I might be able to achieve it by chaining profiles and then adding the shutdown command to final profile. Perhaps this would work.

John

Re: Issue shutdown command when all jobs completed.

Posted: Mon Jan 22, 2024 6:44 pm
by tobias
Hello,
yes that's a good idea.

Re: Issue shutdown command when all jobs completed.

Posted: Mon Jan 22, 2024 7:02 pm
by JDG
I'd assumed a simple shutdown -h now would work after the final profile but it didn't seem to (OpenSuse Leap system). I'd installed through the Windows Linux installer so assumed Syncovery would have root access so no sudo required, but even with " sudo /sbin/shutdown -h now' it doesn't seem to trigger shutdown.

Linux isn't my forte so I need to keep trying. I've probably misread something obvious.

Native support would be great :)

Re: Issue shutdown command when all jobs completed.

Posted: Tue Jan 23, 2024 10:37 am
by JDG
Still trying to get the shutdown command to work after the final job. My lack of Linux knowledge is really showing itself ;)

Logs show:

Code: Select all

Executing: sudo /sbin/shutdown -r now
Cannot execute command line: sudo /sbin/shutdown -r now
The execution is not authorized.
Command "sudo /sbin/shutdown -r now" not listed in file to allow external commands: /usr/lib/Syncovery/authorized_cmdlines_syncovery
Shutdown command works from terminal ok

John

Re: Issue shutdown command when all jobs completed.

Posted: Tue Jan 23, 2024 10:55 am
by tobias
Yes, you need to add the command line to the file:
/usr/lib/Syncovery/authorized_cmdlines_syncovery

This is a security measure.

The file has to be owned by root too, and disallow other users from writing to it.

I don't think you need the sudo.

Re: Issue shutdown command when all jobs completed.

Posted: Tue Jan 23, 2024 11:56 am
by JDG
Hi Tobias,

Thanks for your help - it works!

I've now got a totally hands-off backup that powers on each day, Syncovery runs it's profiles and then shuts the box down.
I did find that shutdown -h +5 is more suitable than an immediate shutdown. In fact, I created an extra profile that backs up a single unchanging file and made this the last profile in the chain. This then calls the shutdown command. I wanted to make sure that the penultimate profile totally completed before issuing the shutdown command.

Thanks again for all your help.

All the best

John