The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   retarded maintenance scripts (http://hintsforums.macworld.com/showthread.php?t=5578)

mervTormel 09-16-2002 11:28 AM

"fsck it, drive on"

jpkelly 09-16-2002 03:36 PM

OK I already know the answer to this one. (man fsck)
How exactly does one fsck it?
Is there a fsck for dummies?

mervTormel 09-16-2002 04:18 PM

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
    cd /var/tmp && {
    find . -fstype local ! -name . -atime +7 -ctime +3 -exec rm -f -- {} \;
    find -fstype local -d . ! -name . -type d -mtime +1 -exec rmdir -- {} \; \
        >/dev/null 2>&1; }
fi

that first find causes the rm errors on dirs. and the second find is just plain wrong...

$ /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...

mervTormel 09-16-2002 04:55 PM

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 ]; then
    cd /tmp && {

# bdd; 16sep02; attempt to fix this tripe
#  find . -fstype local -type f -atime +3 -ctime +3 -exec rm -f -- {} \;
#  find -fstype local -d . ! -name . -type d -mtime +1 -exec rmdir -- {} \; \
   
    find . -fstype local -type f -atime +3 -ctime +3 -exec rm -f -- {} \; 
    find . -fstype local -type d ! -name . -mtime +1 -exec rmdir -- {} \; \
        >/dev/null 2>&1; }
fi

if [ -d /var/tmp ]; then
    cd /var/tmp && {

# bdd; 16sep02; attempt to fix this tripe
#  find . -fstype local ! -name . -atime +7 -ctime +3 -exec rm -f -- {} \; 
#  find -fstype local -d . ! -name . -type d -mtime +1 -exec rmdir -- {} \; \
   
    find . -fstype local -type f -atime +7 -ctime +3 -exec rm -f -- {} \; 
    find . -fstype local -type d ! -name . -mtime +1 -exec rmdir -- {} \; \
        >/dev/null 2>&1; }
fi

i think that might begin to start to approach ever closer to almost the right thing.

if 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

jpkelly 09-16-2002 09:12 PM

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.