Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


keyur
  •  keyur
  • Free support Topic Starter
2018-02-08T23:30:21Z
Hello,

I am trying to emulate the function of supervisord on Windows.

Basically, I am executing running a command from the command line (using the execute task feature of VisualCron)
the command is as follows:
php artisan horizon

https://laravel.com/docs...orizon#deploying-horizon 

In unix, when running supervisord, it monitors the task and restarts if it crashes.

Is there anyway to specify that functionality in VisualCron?

When I run the task in VisualCron, it works and starts the process. It also runs indefinitely, but I'm not sure how to monitor it and restart if necessary.


task_2.JPG task_1.JPG
Sponsor
Forum information
Support
2018-02-13T09:11:15Z
You can call a batch file with START to fork a process:

https://stackoverflow.co...rk-in-windows-batch-file 
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keyur
  •  keyur
  • Free support Topic Starter
2018-02-15T07:45:48Z
I am looking into that.
I have created a batch file to start the command.

start "horizontest" cmd /k "C:\myfiles\laragon\bin\php\php-7.1.7-Win32-VC14-x64\php.exe C:\myfiles\laragon\www\alloy\artisan horizon"



should I monitor if the process is running through visualcron or batch?

It seems that this doesn't let you specify a process name, so I wouldn't have any way of transferring the process name to visualcron

thank you
keyur
  •  keyur
  • Free support Topic Starter
2018-02-15T07:56:19Z
I think I got it to work with the following bat file

@echo off
set Token=HORIZON_%RANDOM%_%CD%
start "%Token%_1" cmd /c "C:\myfiles\laragon\bin\php\php-7.1.7-Win32-VC14-x64\php.exe C:\myfiles\laragon\www\alloy\artisan horizon"
:loop
ping -n 2 localhost >nul 2>nul
tasklist /fi "WINDOWTITLE eq %Token%_1" | findstr "cmd" >nul 2>nul && set Child1=1 || set Child1=
if not defined Child1 goto endloop
goto loop
:endloop
echo child died.
C:\myfiles\laragon\www\alloy\horizon.bat

---

It basically calls itself upon failure.
Scroll to Top