B
B
BloodVIRUS2019-08-29 22:09:33
linux
BloodVIRUS, 2019-08-29 22:09:33

How to run script in cron?

Hello. It seems to be a rather trivial task, but I've been worrying about it all evening.
The task is simple, execute reload.sh once a minute
What I do, I go to crontab -e
add: */1 * * * * /reload.sh >/tmp/wp.sh.log 2>/tmp/wp.sh.error .log
script is even just put in the root of the server. But the script is not executed, it outputs to the logs:
cat /tmp/wp.sh.error.log
/bin/sh: 1: /reload.sh: not
found for some reason it doesn't find it.. But it's definitely at the root, it's definitely there, and it's definitely working:
cat /reload.sh
#!/bin/bash
echo "done";
chmod +x did.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vreitech, 2019-08-29
@BloodVIRUS

*/1 * * * * /bin/bash /reload.sh >/tmp/wp.sh.log 2>/tmp/wp.sh.error.log

A
Adamos, 2019-08-29
@Adamos

# m h dom mon dow user	     command
*/1 *  *   *   *  /reload.sh >/tmp/wp.sh.log 2>/tmp/wp.sh.error.log

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question