O
O
OM12017-03-04 00:15:17
ubuntu
OM1, 2017-03-04 00:15:17

How to run a cron task on firstvds.ru (Ubuntu-16.04-x86_64)?

Hello.
I want to run php by cron, what I do:
1. cron task file test :
SHELL=/usr/bin/php
[email protected]
* * * * * /var/www/html/test.php 2>/ tmp/tmp.cron
2. crontab dir/ test
3. crontab -l : task hangs, but silence.... PHP script working!
As I understand it, the plug is on the way to the php interpreter?!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OM1, 2017-03-04
@OM1

In short, the problem is this: cron works well, but php and python scripts are not executed,
explicit launch works (python myScript.py), but bash /var/www/html/myScript.py does not work,
therefore cron does not start either. ..
How to be here?
Thanks

D
Dmitry Dobryshin, 2017-11-25
@serg_small_developer

Everything is described in your program.
If there are no access rights, return empty content.
If the file does not exist, return empty content
If the length is zero, return empty content
If it is impossible to append, return empty content
Either the file is not where you expect, or the file cannot be read and written by the www-data user, or everything else.
start with debugging - at least write down in the log which of the conditions worked in order to understand what the problem is.
PS. If someone's answer helped you, mark it. Helping is an incentive to continue to help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question