LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 07:49 AM   #1
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Rep: Reputation: Disabled
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, 07:52 AM   #2
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
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 07:55 AM.
 
Old 05-12-2014, 08:02 AM   #3
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Original Poster
Rep: Reputation: Disabled
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, 08:05 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 636

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

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

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


Reply



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 07:24 AM
I can execute shell script from CLI but failed to do via cron UltraSoul Linux - Software 2 06-24-2008 10:10 PM
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
Script does not execute with cron Arty Ziff Linux - Newbie 14 05-23-2008 12:08 AM
How to set up cron job to execute bash script lgmqy2000 Linux - General 4 11-22-2006 04:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:43 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
Open Source Consulting | Domain Registration