New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autostart Scripts after script-server start? #712
Comments
Hi @klauweg , unfortunately it's not :( |
Can you edit the script to be a wrapper, and check for it's own "last run
date" (via a touch file or similar mechanism)? Then, if it hasn't run since
"x", run.
Then you could schedule that job to run frequently enough to catch a
restart.
For that matter... Bugy, is there a place to look for "Scriptserver's last
start time"? You could then compare the last script run to SS's last start,
and run if SS restarted since the last run. And then schedule as above.
…On Fri, Nov 3, 2023, 2:16 AM Iaroslav Shepilov ***@***.***> wrote:
Hi @klauweg <https://github.com/klauweg> , unfortunately it's not :(
—
Reply to this email directly, view it on GitHub
<#712 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3HBI3X6KUWCXAHHHUNJLPDYCSD2PAVCNFSM6AAAAAA633WYJWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJRHEZTMOJZHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Or, leave the script itself alone, except for adding said touchfile, and
then schedule a separate watchdog that does the SS-vs-script-last-run
comparison, and runs the scripts behind itself if SS has restarted since
last runs.
…On Fri, Nov 3, 2023, 11:40 AM Mark Neill ***@***.***> wrote:
Can you edit the script to be a wrapper, and check for it's own "last run
date" (via a touch file or similar mechanism)? Then, if it hasn't run since
"x", run.
Then you could schedule that job to run frequently enough to catch a
restart.
For that matter... Bugy, is there a place to look for "Scriptserver's last
start time"? You could then compare the last script run to SS's last start,
and run if SS restarted since the last run. And then schedule as above.
On Fri, Nov 3, 2023, 2:16 AM Iaroslav Shepilov ***@***.***>
wrote:
> Hi @klauweg <https://github.com/klauweg> , unfortunately it's not :(
>
> —
> Reply to this email directly, view it on GitHub
> <#712 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A3HBI3X6KUWCXAHHHUNJLPDYCSD2PAVCNFSM6AAAAAA633WYJWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJRHEZTMOJZHE>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
|
@MNeill73 unfortunately there is no simple way to find out the last start time. The only way is to read server.log |
That's a relatively trivial task, though...in bashlike form...
SSStartLog=`grep "*some identifiable start string from the log*"
/path/to/server.log | awk "{print *$the $fields $that $are $the $date*}"`
SSStart=`date --date="${SSStartLog}" %+"%s"`
And now you have Scriptserver's start time in epoch format. Then...
TouchfileTime=`stat -c %y */path/to/touchfile*` # File last
modification date in human-readable form
TouchfileLast= `date --date="${TouchfileTime}" %+"%s"`
And that's the touchfile's last modification in the same form. Compare the
two, run if *${SSStart} > ${TouchfileLast}*.
Message ID: ***@***.***>
… |
Hm, i thought about some tricks with the scheduling feature already. |
Maybe it could be feasible to create scheduling entries by a wrapper for script-server before starting it. Every configured script with enabled scheduling gets a one-shot entry let's say for one minute later. Afters starting script-server all prepared scripts will be started with a little delay. Of course i would prefer to have a button on script-server webinterface to start them itself ;-). |
Hello, |
Is it possible to start scripts automatically after starting launcher.py?
The text was updated successfully, but these errors were encountered: