|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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!!" |
|
#3
|
|||
|
|||
|
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. |
|
#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? |
|
#5
|
||||
|
||||
|
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. |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
So you can't run any crons on your other system? Have you tried running a cron for another script?
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Cron entry running on a server and not on another |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|