LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-12-2014, 08:49 AM   #1
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Rep: Reputation: 5
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?
 
Old 05-12-2014, 08:52 AM   #2
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
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.

Last edited by eklavya; 05-12-2014 at 08:55 AM.
 
Old 05-12-2014, 09:02 AM   #3
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
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!
 
Old 05-12-2014, 09:05 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
Try this.
Quote:
* * * * * cd /path/to/poolcntr | ./poolcntr
 
Old 05-12-2014, 09:20 AM   #5
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
Interesting, that doesn't work. I would have thought it would. This does work:

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
My oracle server does not execute a script on linux by cron farnaw4u Linux - Server 1 03-06-2010 08:24 AM
I can execute shell script from CLI but failed to do via cron UltraSoul Linux - Software 2 06-24-2008 11:10 PM
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 09:09 AM
Script does not execute with cron Arty Ziff Linux - Newbie 14 05-23-2008 01:08 AM
How to set up cron job to execute bash script lgmqy2000 Linux - General 4 11-22-2006 05:29 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration