|
|
#1 |
|
Triple-A Player
Join Date: Mar 2002
Location: San Francisco
Posts: 57
|
I would love to know MT's findings on the new maint scripts.
I changed the crontab commands back to the old ones because I like to get the mail it sends out. Gives me a bit of reassurance that the servers are running ok and I have even spotted and fixed some problems I spotted in the mail. I have also added psync and rsync commands to /etc/daily.local to back up my system and mirror web pages to another machine. |
|
|
|
|
|
#2 |
|
MVP
Join Date: Jan 2002
Posts: 1,562
|
I don't suppose you could detail what you did to get back to the old-style maint scripts could you. I too like getting the mail.
|
|
|
|
|
|
#3 |
|
Triple-A Player
Join Date: Mar 2002
Location: San Francisco
Posts: 57
|
I used Webmin to edit the crontab but you could use CronniX or whatever other method to edit crontab.
I changed Code:
periodic daily periodic weekly periodic monthly Code:
sh /etc/daily 2>&1 | tee /var/log/daily.out | mail -s "`hostname` daily output" root sh /etc/weekly 2>&1 | tee /var/log/weekly.out | mail -s "`hostname` weekly output" root sh /etc/monthly 2>&1 | tee /var/log/monthly.out | mail -s "`hostname` monthly output" root |
|
|
|
|
|
#4 |
|
Guest
Posts: n/a
|
Another way to get the log mailed to you is leave the crontab as is and add a file called periodic.conf.local in your /etc directory.
Then add the following into the file: daily_output="username" weekly_output="username" monthly_output="username" Where username is your username. What this doesn't get you though is an email and output written to a file. If you want both go with jpkelly's suggestion. |
|
|
|
#5 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
enola, thanks.
seems that periodic could have scored a little better in the output flexibility dept. perhaps some tee pipe fitting could be done somewheres to get the singular log back in /var/log and mail sent, e.g., daily_output="tee /var/log/daily.out root" # tee /file mailto:user ... /usr/sbin/periodic... case "$output" in tee*) pipe= some crazy machinations to get tee stuffed before mail /*) pipe="cat >>$output";; "") pipe=cat;; *) pipe="mail -s '$host ${arg##*/} run output' $output";; esac ... ¡no me gusta! Last edited by mervTormel; 09-14-2002 at 01:25 PM. |
|
|
|
|
|
#6 |
|
Guest
Posts: n/a
|
I was thinking maybe that's what "") pipe=cat;; was intended for. To generate output to be piped to whatever the user wants. So if you set
daily_output ="" You could change your crontab to something like the old style entry: periodic daily | tee /var/log/daily.out | mail -s "`hostname` daily output" username I haven't actually tried this but looks like it should work. Last edited by enola; 09-14-2002 at 01:51 PM. |
|
|
|
#7 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
yep. you're right. heh.
::keep it stupid, simple syndrome:: thank you for your support. |
|
|
|
|
|
#8 |
|
MVP
Join Date: Jan 2002
Posts: 1,562
|
Am I understaning this correct....
/etc/periodic.conf.local daily_output="" weekly_output="" monthly_output="" --- /etc/crontab periodic daily | tee /var/log/daily.out | mail -s "`hostname` daily output" root |
|
|
|
|
|
#9 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
roger. that looks copacetic.
|
|
|
|
|
|
#10 | |||||||||||||||||||
|
MVP
Join Date: Jan 2002
Posts: 1,562
|
This is the e-mail I got this morning - after the first run of daily - setup as described:
"No output from the 2 files processed" Any ideas?
|
|||||||||||||||||||
|
|
|
|
|
#11 |
|
Guest
Posts: n/a
|
I just tried this in my cron and I got the expected results. A daily.out and an email.
Try running just from the command line: sudo periodic daily You should get output like what shows up in the log. I'd start there for troubleshooting. |
|
|
|
#12 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
hmm, works here. is there a /var/log/daily.out? if not, i suspect your crontab line, maybe. make sure the command doen't wrap, i.e., the command has to be all on one line.
|
|
|
|
|
|
#13 | |||||||||||||||||||
|
MVP
Join Date: Jan 2002
Posts: 1,562
|
Running in the CLI I get the same results:
> sudo periodic daily > No output from the 2 files processed /var/log/daily.out is empty
I noticed in the /periodic/* files they both start with: if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf source_periodic_confs fi Inside the /etc/defaults/periodic.conf file it shows that /etc/periodic.conf.local overides variables in /etc/defaults/. My /etc/periodic.conf/local contains nothing but this: daily_output="" weekly_output="" monthly_output="" I am not seeing where or how the mechanism works to create and send the output. Last edited by bluehz; 09-15-2002 at 05:06 PM. |
|||||||||||||||||||
|
|
|
|
|
#14 |
|
Guest
Posts: n/a
|
Do you have a /etc/defaults/periodic.conf file? There is a line in there for overriding the values:
Code:
# What files override these defaults ? periodic_conf_files="/etc/periodic.conf /etc/periodic.conf.local" sudo /etc/daily Do you get output? I just ran like this and get the normal output. Have you edited the daily script at all? Something is funky. |
|
|
|
#15 |
|
MVP
Join Date: Jan 2002
Posts: 1,562
|
Trying that as we speak:
Just manually ran daily.local. Terminal shows a good output up to the locate.updatedb stuff. Then and error: Updating the Locate db: /usr/libexec/locate.updatedb: line 45: syntax error near unexpected token `setenv' /usr/libexec/locate.updatedb: line 45: `if (! $?TMPDIR) setenv TMPDIR /var/tmp' I remember reading there was a syntax error there and a solution - but for the life of me I can not locate that info now! |
|
|
|
|
|
#16 | |||||||||||||||||||
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
My /etc/periodic.conf/local ? you mean /etc/periodic.conf.local ? at the end of /etc/defaults/periodic.conf , a function is defined for slurping up the /etc/periodic.conf.local file. if you are out of rev on any of the vanilla periodic files, i suggest you get them back to vanilla and try again. all periodic files should be vanilla, and you should create one file, /etc/periodic.conf.local containing daily_output="" for now. |
|||||||||||||||||||
|
|
|
|
|
#17 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
45 if (! $?TMPDIR) setenv TMPDIR /var/tmp
no syntax error here. are you talking about the term_program syntax error? "There is a typo in /usr/share/tcsh/examples/aliases..." http://www.macosxhints.com/article.p...20826003806202 different thing altogether. are you running stock csh ? or have you managed to skronk that, too? |
|
|
|
|
|
#18 | |||||||||||||||||||
|
Guest
Posts: n/a
|
Okay, I take it by this that you've got a /etc/daily and a /etc/daily.local. Go with mT's advice and go back to a vanilla setup. Rename daily.local to something else so that it doesn't get called by /etc/daily and that things finish correctly. |
|||||||||||||||||||
|
|
|
#19 |
|
Triple-A Player
Join Date: Mar 2002
Location: San Francisco
Posts: 57
|
got this in the mail today:
From daily output Subject: crabtree daily run output Removing scratch and junk files: rm: ./Mount01: is a directory rm: ./Mount02: is a directory rm: ./Mount03: is a directory rm: ./Mount04: is a directory rm: ./zBooterMnt: is a directory What does it mean? |
|
|
|
|
|
#20 |
|
MVP
Join Date: Jan 2002
Posts: 1,562
|
Virgin install and everything seems to be working now. Got the e-mail and all. Thanks guys for the help.
FYI - I also see the: Removing scratch and junk files: rm: ./Mount01: is a directory rm: ./Mount02: is a directory rm: ./Mount03: is a directory rm: ./Mount04: is a directory rm: ./zBooterMnt: is a directory |
|
|
|
![]() |
|
|