![]() |
retarded maintenance scripts
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. |
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.
|
I used Webmin to edit the crontab but you could use CronniX or whatever other method to edit crontab.
I changed Code:
periodic dailyCode:
sh /etc/daily 2>&1 | tee /var/log/daily.out | mail -s "`hostname` daily output" root |
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. |
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! |
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. |
yep. you're right. heh.
::keep it stupid, simple syndrome:: thank you for your support. |
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 |
roger. that looks copacetic.
|
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? Quote:
|
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. |
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.
|
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 Quote:
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. |
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 ?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. |
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! |
Quote:
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. |
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? |
Quote:
|
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? |
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 |
"fsck it, drive on"
|
OK I already know the answer to this one. (man fsck)
How exactly does one fsck it? Is there a fsck for dummies? |
uh, you misinterpreted my meaning :D
rephrasing: eff it, drive on... the "rm: ./Mount01: is a directory" errors are due to brain damage somewhere, but, since those dirs are empty, it's not very interesting. there are some other problems with the daily cleaner code... Code:
if [ -d /var/tmp ]; then$ /usr/bin/find -fstype local -d . stype: -d: unknown option even reduction doesn't help... $ /usr/bin/find -fstype local . stype: stype: No such file or directory stype: local: No such file or directory . ./3d84c825109b0 ... since the objective of the second find is to rmdir, i think it should read... $ /usr/bin/find . -fstype local -type d ! -name . # and so on... ./mds ./Mount01 ./Mount02 ./Mount03 ./Mount04 ./vi.recover ./zBooterMnt but, i'll just let her buck... |
hmm, after looking at the tmp cleaner code, i thought that it is all brain damaged, so i hacked on it...
Code:
if [ -d /tmp ]; thenif you mod your daily script, be sure to save the original distribution... $ sudo cp -p /etc/periodic/daily/500.daily /etc/periodic/daily/500.daily.10.2.dist |
well that seemed to get rid of the offending dirs...
I had considered changing the 'rm -f' part to 'rm -rf' but that probably would not have been a good idea. |
| All times are GMT -5. The time now is 06:12 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.