LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Crontab isn't working (https://www.linuxquestions.org/questions/linux-newbie-8/crontab-isnt-working-4175621334/)

tocii. 01-10-2018 03:47 AM

Crontab isn't working
 
Hi everyone. I want schedule for explame a bash script, to write out "Hello World.".
I opened the file with command: 'crontab -e', then wrote to the last line '* * * * * sh /home/test.sh'
But it isn't working, I can't see that "hello World" message.
Someone can help me? Thank you!

JJJCR 01-10-2018 04:06 AM

what's inside test.sh?

if you run ./test.sh are you able to see the "Hello World."

or try this:

* * * * * /home/test.sh

I remove sh before the forward slash

tocii. 01-10-2018 04:08 AM

Yes, when I run the Shell script in terminal with 'sh /home/test.sh' command, then work good.

JJJCR 01-10-2018 04:11 AM

I edited my post see updated post above.

tocii. 01-10-2018 04:16 AM

I saw that. But isn't good.

EDIT: Or crontab running only in the background?

AwesomeMachine 01-10-2018 04:45 AM

I don't know how cron interprets all *. I think you might require a number somewhere in there. And, the script will probably print to /var/log/messages if it's run from the cron daemon.

tocii. 01-10-2018 06:13 AM

I solved the problem. thanks everything.

JJJCR 01-10-2018 10:47 PM

If you can share your solution, so others who might have the same issue is able to benefit from it. If you will be kind to share though.


All times are GMT -5. The time now is 07:01 PM.