Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old April 4th, 2008, 07:59 AM
mrkkhattak mrkkhattak is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Pakistan
Posts: 79 mrkkhattak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 42 m 50 sec
Reputation Power: 4
Cron entry running on a server and not on another

I add the following to cron entry on one of our debian server:

#Cron Entry
* * * * * /home/Scripts/customFetch.sh

It works fine and this script is executed every minute without any problem and I see that it is updating its logs correctly in /var/logs/syslog.

Though, when I add the same cron entry to our backup debian server it doesn't run. I have checked the logs and I don't see that it is throwing any error.

I am adding this entry on both servers using root. I am using the same Debian OS on both servers. After adding this cron entry when I check it with crontab -l it shows the correct entry in the list.

Could anybody let me know if I am doing anything wrong?

Thanks in advance.

-Meraj

Reply With Quote
  #2  
Old April 5th, 2008, 05:57 AM
atlantisstorm atlantisstorm is offline
Hang your freedom higher.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level)atlantisstorm User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 10 h 14 m 2 sec
Reputation Power: 113
What happens when/if you run the .sh script from the command prompt?
__________________
"Badges? We ain't got no badges. We don't need to badges! I don't have to show you any stinkin' badges!!"

Reply With Quote
  #3  
Old April 9th, 2008, 05:39 PM
Thoku Thoku is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 175 Thoku User rank is Sergeant (500 - 2000 Reputation Level)Thoku User rank is Sergeant (500 - 2000 Reputation Level)Thoku User rank is Sergeant (500 - 2000 Reputation Level)Thoku User rank is Sergeant (500 - 2000 Reputation Level)Thoku User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 2 h 3 m 34 sec
Reputation Power: 13
I certainly know that if a password expires then the crons for that user will stop being executed but I can't imagine that is the case given that it is the root account rather than an "automation" account that this is running under.

But I would agree with atlantis that you need manually run the cron to see what happens.

Reply With Quote
  #4  
Old April 17th, 2008, 01:05 AM
mrkkhattak mrkkhattak is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Pakistan
Posts: 79 mrkkhattak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 42 m 50 sec
Reputation Power: 4
When I run the script from shell, it works fine. But when I add the above line to the cron, then it doesn't run.

I see that the other cron entries present in /etc/cron.d/ are running fine.

Is there any thing I am missing or I should try to add the same cron entry in some other way?

Reply With Quote
  #5  
Old April 17th, 2008, 07:11 AM
compmodder26's Avatar
compmodder26 compmodder26 is offline
Giggity Giggity!!
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2004
Posts: 801 compmodder26 User rank is Captain (20000 - 30000 Reputation Level)compmodder26 User rank is Captain (20000 - 30000 Reputation Level)compmodder26 User rank is Captain (20000 - 30000 Reputation Level)compmodder26 User rank is Captain (20000 - 30000 Reputation Level)compmodder26 User rank is Captain (20000 - 30000 Reputation Level)compmodder26 User rank is Captain (20000 - 30000 Reputation Level)compmodder26 User rank is Captain (20000 - 30000 Reputation Level)compmodder26 User rank is Captain (20000 - 30000 Reputation Level)compmodder26 User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 11 h 42 m 14 sec
Reputation Power: 208
It might be a problem with cron's environment. Run the command `env` from the command line and have cron run the same command. Have both output to separate files. Compare the two, and if you find anything that is missing from cron's `env` output that may be pertinent, declare those variables at the top of your script.
__________________




Spread Ubuntu

(\ /)
(O.o)
(> <)
This is Bunny. Copy Bunny into your signature to help him on his way to world domination.

Reply With Quote
  #6  
Old April 25th, 2008, 08:29 AM
mrkkhattak mrkkhattak is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Pakistan
Posts: 79 mrkkhattak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 42 m 50 sec
Reputation Power: 4
Thanks, compmodder26.

I was able to solve this problem by adding/editing cron entries by

Code:
crontab -e


Before that, I wrote my cron entries in a text file and imported to the cron, using
Code:
crontab fileName


Though, the above method worked on one system and didn't work on another.

-Meraj

Last edited by mrkkhattak : April 25th, 2008 at 08:29 AM. Reason: Correct grammer

Reply With Quote
  #7  
Old April 27th, 2008, 10:58 PM
MicrosonicHost MicrosonicHost is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 6 MicrosonicHost User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 50 m 53 sec
Reputation Power: 0
So you can't run any crons on your other system? Have you tried running a cron for another script?

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Cron entry running on a server and not on another


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway