Using the Windows version, is there a way to specify a command to be run on completion of a job (from the Settings/Synchronization screen), but then wait for that command to complete before executing the "When finished" action (such as System: Sleep) on the progress view?
I have a batch script I run at the completion of a job that takes ~30 seconds to complete, but it doesn't get a chance to finish as the "When finished" action kicks in immediately after the actual copy job is complete. My preference is that the add-on "Run a command" be considered part of the overall job and the "When Finished" action is executed after the "Run a command" has completed.
I already know I can just add the "system sleep" to the end of my "Run a command" batch script and not use the "When finished" function (that's my work-around right now), but I like the ability to add the "System: Sleep" after the job is already running rather than having to decide to do the sleep at the start of the job. For example, if a long job is running past quitting time and I don't want my PC left on all night, I'd like to be able to set the "System: Sleep" and then walk away knowing it'll all complete and then sleep the PC.
Thx!
Run a command 'On completion' and WAIT
- Posts: 3
- Joined: 27 Mar 2022
- Posts: 1202
- Joined: 8 May 2006
Will sleeping from your batch file work for you?
How can I put the computer to sleep from Command Prompt/Run menu?
(PsShutdown or NirCmd look to be the relevant utilities.)
Also look at CMD.
Instead of running batchfile.bat directly, see if CMD /K batfile.bat (with a specific exit, on completion, in your batch file) works? (Or maybe a START CMD /K batchfile.bat, kind of thing?)
How can I put the computer to sleep from Command Prompt/Run menu?
(PsShutdown or NirCmd look to be the relevant utilities.)
Also look at CMD.
CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
[[/S] [/C | /K] string]
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
- Posts: 3
- Joined: 27 Mar 2022
While I appreciate the response, as I stated in my 3rd paragraph, I already have sleeping from the batch file working (I prefer to use Steve Gibson's wizmo.exe for the sleep function -- works flawlessly). My desire is to be able to add the sleep while the job is already running, so cases when it's running long and I want to "go home" and know it'll finish and sleep the PC when complete, without having to make that decision when I invoke the job.
I played around with numerous flavors of invoking the batch job as you suggest, but suspect the problem is internal to the FFS program. The "When finished" action (on the progress screen) only looks at the actual backup job and doesn't take into account any "Run a command" action specified on the Synchronization screen. Fixing this will likely require a change to the base program, but I think it would be a valuable change as I can't envision a use case where the current scheme is ever desired (that is, sleeping or shutting down while a "Run a command" is still running in the background).
I played around with numerous flavors of invoking the batch job as you suggest, but suspect the problem is internal to the FFS program. The "When finished" action (on the progress screen) only looks at the actual backup job and doesn't take into account any "Run a command" action specified on the Synchronization screen. Fixing this will likely require a change to the base program, but I think it would be a valuable change as I can't envision a use case where the current scheme is ever desired (that is, sleeping or shutting down while a "Run a command" is still running in the background).
- Posts: 1202
- Joined: 8 May 2006
So that's the pertinent part.My desire is to be able to add the sleep while the job is already running
You start it & decide you want to go home - before or during the backup processes.
So if you have an 'On completion:' command, ffs_is_done.bat, have a batch file that changes it - prior to its execution.
Still a work-around, but...
IMGOINGHOME.bat
copy /y ffs_is_done_HOME.TXT ffs_is_done.bat
copy /y ffs_is_done_HERE.TXT ffs_is_done.bat
@echo off
echo hi there you swine
echo.
echo echo'ing > c:/out/textedit/x/newfile
echo > C:\out\textedit\X\newfile
echo newfile created, DONE.
echo.
echo running cleanup scripts...
echo sleeping 3 seconds...
sleep 3
echo i shall now exit my script
sleep 1
exit
@echo off
echo hi there you swine
echo.
echo echo'ing > c:/out/textedit/x/newfile
echo > C:\out\textedit\X\newfile
echo newfile created, DONE.
echo.
echo running cleanup scripts...
echo sleeping 3 seconds...
sleep 3
echo i shall now exit my script & SLEEP the computer
sleep 1
wizmo.exe standby
exit
When you come back in the next morning (afternoon), click the IMHERE icon to reset ffs_is_done.bat back to its default of not sleeping (standby).
- Posts: 3
- Joined: 27 Mar 2022
Thanks! It didn't occur to me to change the batch script "under the covers" after it had already been specified as part of the job. Makes total sense as a better workaround.
But ... I would still argue a change to the base program to implement it directly (in my humble opinion) would be a worthwhile enhancement. Hopefully the program author will see this and comment on it.
But ... I would still argue a change to the base program to implement it directly (in my humble opinion) would be a worthwhile enhancement. Hopefully the program author will see this and comment on it.