M
M
marenco_victor2015-01-29 12:04:54
Task Schedulers
marenco_victor, 2015-01-29 12:04:54

How to make a script run every second using Cron?

There is a php script that, if the time has come, and the time when you need to start working is randomly generated in the range from 1 to 4, starts working with the database, how can this be implemented in conjunction with CRON

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hiloader, 2015-01-29
@hiloader

Write a resident program on the same shell, add it to runlevel and don't torture crons:

while sleep 1
do
    do_smt_here
done

It's not entirely clear what you need - once a second or from one to 4. If the latter, then there are no ideas at all how to get cron to generate numbers for you.

I
Igor, 2015-01-29
@merryjane

You can use the following daemon:
search.cpan.org/~kohts/snaked-0.14/lib/snaked.pm
This is essentially a cron "on steroids" with the ability to run tasks per second.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question