LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trouble getting cron to execute script (https://www.linuxquestions.org/questions/linux-newbie-8/trouble-getting-cron-to-execute-script-4175504710/)

battles 05-12-2014 07:49 AM

Trouble getting cron to execute script
 
I have a script that executes from within /home/path/to/ poolcntr ok:

./poolcntr

When I try to execute this cron job, it doesn't execute:

*/1 * * * * /home/path/to/poolcntr

What is wrong here?

eklavya 05-12-2014 07:52 AM

Quote:

* * * * * sh /path/to/poolcntr.sh
if poolcntr is a shell script file
OR
Quote:

* * * * * cd /path/to/poolcntr && ./poolcntr
Make sure file poolcntr is executable.

battles 05-12-2014 08:02 AM

Yes, that works. I saw an example on another site similar to this, but I think that it didn't have the && in it.

Thanks!

eklavya 05-12-2014 08:05 AM

Try this.
Quote:

* * * * * cd /path/to/poolcntr | ./poolcntr

battles 05-12-2014 08:20 AM

Interesting, that doesn't work. I would have thought it would. This does work:

*/1 * * * * cd /path/to/poolcntr && ./poolcntr


All times are GMT -5. The time now is 06:49 PM.