Page 1 of 2

job execute after not running

Posted: Mon Jan 30, 2023 2:50 am
by PeterC
I have a simple cmd file that I want to run after a profile is finished so I entered the full path to the file (see screenclip) but it doesn't run.

It timesout with the following in the log file:
Executing: C:\Users\Peter\pj\Scripts and Reg files\WombatSleepNoPause.cmd
Executed C:\Users\Peter\pj\Scripts and Reg files\WombatSleepNoPause.cmd
The external command line took too long (Timeout: 120 sec).

The profile runs as administrator.

The cmd file runs ok if I try it outside of Syncovery.
20230130 execute after.jpg
20230130 execute after.jpg (30.94 KiB) Viewed 2619 times

Re: job execute after not running

Posted: Mon Jan 30, 2023 10:16 am
by tobias
Hello,
the script is probably run in a different context, so you need to debug it.

For example, add logging.

Re: job execute after not running

Posted: Thu Feb 02, 2023 5:44 am
by PeterC
I don't know what you mean by "different context".

I have stripped the job specs down to one line directly entered in the Job > Execute After box.

The command is "C:\CustomApps\ProgramFiles\SPSSuite\SyMenuSuite\PsTools_sps\psshutdown64.exe -d -t 0 -u administrator -p password \\wombat"

This entry still timesout without running.

Hopefully you can suggest a solution.

Re: job execute after not running

Posted: Thu Feb 02, 2023 9:41 am
by tobias
Hello,
you need to ask the developer of psshutdown64.exe on how to to debug it.

What are you trying to achieve? Maybe we can find a better way to do it.

Re: job execute after not running

Posted: Thu Feb 02, 2023 9:52 am
by PeterC
I'm trying to suspend/sleep the computer called Wombat. Any suggestions?

Re: job execute after not running

Posted: Thu Feb 02, 2023 10:10 am
by tobias
So Wombat is another PC on the LAN?

What I meant with "context" is for example, if the scheduler runs as a service, it is a completely different environment from normal applications and some external tools may not work in that context.

You can compare a log file where it works agains one where it doesn't. Look at the top in the log file where it says "Running as".

But that's not the only difference. It could also be a Firewall or other things preventing the script.

Re: job execute after not running

Posted: Thu Feb 02, 2023 11:28 am
by PeterC
Yes, Wombat is another PC on the local network.

Re: job execute after not running

Posted: Sat Feb 04, 2023 5:57 am
by PeterC
I'm still having problems running a simple job after the profile runs.

I've got a simple cmd file that's only got the command "pause" in it and it won't run in the background. It will run if I do an Attended run.

Any ideas?

Re: job execute after not running

Posted: Sat Feb 04, 2023 11:28 am
by tobias
Hello,
there are many different ways to start a profile "in the background". You really need to provide more details.

If you let it start by the scheduler and the scheduler runs as a service, then you surely won't see the command prompt window that runs the CMD file.

You need to compare a working Syncovery log file versus non-working. Look at "Running As" at the top.

Re: job execute after not running

Posted: Sun Feb 05, 2023 12:15 am
by PeterC
When I run the profile Attended the cmd file executes ok - log says "Running as : Tornado\Peter (not Admin)"

When the profile is run by the scheduler service the cmd file timesout - log says "Running as : Tornado\Administrator (Admin)"

I can successfully run the cmd file outside of Syncovery - both as user Peter as well as Administrator.