I
I
Ilya Trusov2016-02-23 20:34:15
PHP
Ilya Trusov, 2016-02-23 20:34:15

How to make crontab work?

Hello.
Added to crontab:

1 * * * * /usr/bin/php /opt/apps/PingPingPing.php > /dev/null 2>&1

The script should be executed once a minute.
If you separately execute /usr/bin/php /opt/apps/PingPingPing.php > /dev/null 2>&1, then everything works, but there is no cron. Added from a regular user. Scripts are executable. But it makes no sense. Magic.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2016-02-23
@artgrosvil

1 * * * * /usr/bin/php /opt/apps/PingPingPing.php > /dev/null 2>&1

This command will run every first minute (i.e. at 0:01, 1:01, 2:01, 3:01, etc.) and not once per minute.
To be once a minute, the command should look like this:
or like this:
or even like this:
0-59 * * * * /usr/bin/php /opt/apps/PingPingPing.php > /dev/null 2>&1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question