Page 1 of 1

Run CRONJOB every Second?

Posted: Mon Feb 29, 2016 11:04 pm
by blackside
Is there any option / hack to run a Cronjob every second in VestaCP?

Thanks.

Re: Run CRONJOB every Second?

Posted: Mon Feb 29, 2016 11:52 pm
by imperio
Why do you need this ? o_O
this is possible only via bash script

Re: Run CRONJOB every Second?

Posted: Tue Mar 01, 2016 1:33 pm
by skurudo
Topic was before. I hope this help:
viewtopic.php?t=7411#p24051

Re: Run CRONJOB every Second?

Posted: Wed Mar 02, 2016 6:07 pm
by newtron
No need for bash.. lOl

Here's my script on PHP:

Code: Select all

$c= 0;
a:
""""" YOUR SCRIPT HERE """""
$c++;
if ($c > 11) {
  exit;
} else {
  usleep(4800000); //4.8 segundos
  goto a;
}
Its IMPOSIBLE to run a script every second (for that is better to daemonize an bash script... or python alternative, yo have SQL modules for python and its easy to script).

My scripts repeats the code every 4,8 seconds (time script is executed) and multiplies by 11 (52,8sec..., many times the script needs more than 3secs to finalize) 11 executions with a 1min CronJob..... and yeah... Prehistoric use of GOTO!! (Ohh... those days with my MSX.. )

Re: Run CRONJOB every Second?

Posted: Wed Mar 02, 2016 6:11 pm
by imperio
We cant help you with that. This does not apply to VestaCP

Re: Run CRONJOB every Second?

Posted: Tue Jun 14, 2016 8:07 am
by skurudo