NFS and Cron jobs
Hi--
Now that my new box is up and running I have set up some cron jobs to do some backups from some NFS shares. Only they are not getting made. Can you help me figure out what is going on? Yes, I can access the shared NFS filesystem on the new box. Here is the only error message from /var/log/messages that looks to me to have anything to do with cron and nfs--this was at the time I mounted the nfs shares on the new computer (The new box is named "bak"): Code:
/var/log/messages: Code:
# /etc/crontab: system-wide crontab Code:
/etc/cron.hourly/bkhourod: Code:
More /var/log/messages: What do you see? How might I get this to work? |
Can you run the scripts sucessfully directly from the command line?
I am not sure what the point of "set $(date)" is. |
Oops, I just noticed the bigger problem: why are you using run-parts with the name of a script? run-parts is supposed to take the name of a directory. To just run a single script, omit run-parts.
|
David--
Thanks! OK, I will take out the run-parts parts. :D Never knew what that was for, so I was just copying. Am running one of the scripts right now and it seems to be working. Will report back. David, thank you very much! |
No problem.
run-parts runs all scripts contained in a directory. I believe it parallelizes execution, but that I am not sure of. |
David--
Thanks! Well, I have it working, sort of. I took out the parts about run-parts, then found that the bkhourev was running each hour. So I commented out the first four cron jobs, the ones the distro had inserted there. Do you have any idea what those four jobs are doing, and if I should not have commented them out? They are: Code:
17 * * * * root run-parts --report /etc/cron.hourly |
Those jobs are running all your "normal" routine cron jobs.... If you don't have any other jobs (including, for example, updates of the 'locate' database) then this is not a problem. I would leave them in, myself.
Everything in /etc/cron.hourly is supposed to be run EVERY hour. Everything in /etc/cron.weekly is supposed to be run each week, and so forth. |
David--
OK, I get it. I think. I could set up my own directory, say cron.doug, and put all my special stuff in there, and run it as I wish. That's why when I put in cron.hourly fileA to be run on even hours from 9 am to 7 pm and another to run on odd hours, were getting run every hour, around the clock, right? Except only one of those two was being run. Thanks, David! You are a good teacher. :) |
That's exactly why it was occuring.
You can actually use the crontab utility to install cronjobs of your own as you want, to run any script. |
Thanks, David!
Thanks to your help I was able to get it going. :D Pretty much all is well! |
All times are GMT -5. The time now is 11:21 AM. |