Issue shutdown command when all jobs completed.

English Support for Syncovery on Linux etc.
Post Reply
JDG
Posts: 5
Joined: Mon Jan 22, 2024 1:08 pm

Issue shutdown command when all jobs completed.

Post 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

tobias
Posts: 1669
Joined: Tue Mar 31, 2020 7:37 pm

Re: Issue shutdown command when all jobs completed.

Post 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).

JDG
Posts: 5
Joined: Mon Jan 22, 2024 1:08 pm

Re: Issue shutdown command when all jobs completed.

Post 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

tobias
Posts: 1669
Joined: Tue Mar 31, 2020 7:37 pm

Re: Issue shutdown command when all jobs completed.

Post by tobias »

Hello,
yes that's a good idea.

JDG
Posts: 5
Joined: Mon Jan 22, 2024 1:08 pm

Re: Issue shutdown command when all jobs completed.

Post 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 :)

JDG
Posts: 5
Joined: Mon Jan 22, 2024 1:08 pm

Re: Issue shutdown command when all jobs completed.

Post 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

tobias
Posts: 1669
Joined: Tue Mar 31, 2020 7:37 pm

Re: Issue shutdown command when all jobs completed.

Post 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.

JDG
Posts: 5
Joined: Mon Jan 22, 2024 1:08 pm

Re: Issue shutdown command when all jobs completed.

Post 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

Post Reply