0

I have first tried to execute a php file.

*/10 * * * * /usr/bin/php/ /path/to/file/file.php

I got: -bash: */10: no such file or directory

Then I tried to make it as simple as possible with a curl command. The curl command is working perfectly. But if I try to make a crontab task:

*/10 * * * * curl "https://test.php"

it doesnt work and I get: */10: No such file or directory.

I've also tried

*/10 * * * * /usr/bin/curl/ https://test.php

I don't understand that.

1
  • Why is bash trying to execute a crontab file? Commented Jan 18, 2021 at 13:18

1 Answer 1

0

To parse and execute php, you will need to use the -f flaf and you also don't need a / after the path to the php bin file and so:

*/10 * * * * /usr/bin/php -f /path/to/file/file.php
Sign up to request clarification or add additional context in comments.

7 Comments

Also not working -bash: */10: No such file or directory
Does the path to the php file exist?
Yes, I can open it with vi. I mean the error is also if I make a curl... That doent make sense
Did you use crontab -e to make the entry?
The I get a "?" as return value
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.