Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Running cleanup scripts' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Running cleanup scripts
Authored by: AMacAddict on May 31, '03 09:39:48AM

Freeware available at VersionTracker, MacJanitor, runs the three daily/weekly/monthly cleanup scripts for you.



[ Reply to This | # ]
Running cleanup scripts
Authored by: qrulf on May 31, '03 10:38:52AM

... or you could just open the terminal and type in one or more of the following commands:

sudo periodic daily
sudo periodic weekly
sudo periodic monthly

For more info, type in: man periodic



[ Reply to This | # ]
are there only unix administrators here ?
Authored by: lagroue on May 31, '03 11:58:22AM

Sure...

MacJanitor is handy, except that it never reminds you to launch it. And when it's running, it can't even hide itself, so your desktop is ugly until the task is complete (and locate db is long to build). I dropped it long time ago...

And anybody who knows the Terminal also knows about cron etc.

Frankly, unix systems lead to weird side effects for those who don't have any unix skills : go in to sh or die. Or stand by OS9...



[ Reply to This | # ]
are there only unix administrators here ?
Authored by: Darkshadow on May 31, '03 12:30:01PM

No, go in to sh and learn to live with it; go into perl and die. ;)



[ Reply to This | # ]
are there only unix administrators here ?
Authored by: bostmass on May 31, '03 10:03:30PM

You should give Cronathon a try. You can download it at nonamescriptware.com. You can also use the freeware Cronnix to schedule when it will run so you don't have to remember. Hope that helps.



[ Reply to This | # ]
are there only unix administrators here ?
Authored by: sfn on May 31, '03 10:23:26PM
Try Macaroni.

---
-sfn

[ Reply to This | # ]

are there only unix administrators here ?
Authored by: rusto on Jun 01, '03 06:59:39AM
so your desktop is ugly until the task is complete
Too lazy to type command-H? :)

[ Reply to This | # ]
are there only unix administrators here ?
Authored by: lagroue on Jun 01, '03 07:53:29AM

MacJanitor is deaf. As deaf as a bad-mooded unix administrator.

"Do you want me to work, or to hide ? ... OK, so let me work now, I'll call you back."



[ Reply to This | # ]
are there only unix administrators here ?
Authored by: rusto on Jun 02, '03 11:40:44AM

Works fine for me while hidden. Good doggy.



[ Reply to This | # ]
are there only unix administrators here ?
Authored by: newbish on Jun 02, '03 11:12:48AM
"And anybody who knows the Terminal also knows about cron etc."


Actually, this is not true. A lot of the people on MacOSXHints are here to learn the UNIX-layer of Mac OS X. Certainly, I am one of them. Fortunately, there are also lots of propellar-heads who are on MacOSXHints to teach us and to share what they know. :)

That being said, cron is not the first thing most people hear about during the learning process. A lot of newbies stumble across cron early on and their reaction is, "WOW! I can make my computer do stuff at certain times without having to run another program? COOL!" But what to actually do with it is another mystery. Imagine how silly I felt thinking that the at command was another cron-like command, only to discover that an entry needed to be made in the crontab to make at work.

With all that being said, once you learn about cron and how it works, it is not difficult to edit the crontab to change the times when the janitorial routines actually run. I changed mine to the middle of the day, because that's when my computer is actually powered-on. Here's my actual crontab:

    #minute hour mday month wday who command
    #
    #*/5 * * * * root /usr/libexec/atrun
    #
    # Run daily/weekly/monthly jobs.
    15 12 * * * root periodic daily
    30 13 * * 5 root periodic weekly
    30 14 1 * * root periodic monthly


To change it, I used sudo pico /etc/crontab and changed the times. All the times in the crontab are written in 24hr format. As it reads above, my daily runs at 12:15 PM each day, the weekly runs at 1:30 PM every Friday (5), and the monthly will run at 2:30 PM on the first of the month. This maximizes the odds that periodic will run while my computer is on. The key weakness, though, is the monthly task, which may not run if the 1st falls on a weekend, and I didn't run my computer because I was out doing other things.

If I'm not sure the monthly ran, I can use:

    cat /var/log/system.log | grep "periodic monthly"

to see if it did. Of course, if the daily ran, then I will need to go to the archived log to do the same thing. If you aren't sure that a periodic ran, then you can use the periodic command to force the issue:

    sudo periodic [daily, weekly, or, monthly]
Good luck!

[ Reply to This | # ]
Nice hint...
Authored by: englabenny on Jun 02, '03 01:38:14PM
...to tell me to search and see if those jobs ever ran. I came out with a clever trick to search all of my logs, even the gzipped ones, with this line:

( cat /var/log/system.log ; gzip -dc /var/log/system.log.* ) | grep daily

And I found that the dailies and weeklies ran as proper scheduled, the daily had rum for example almost every third day..

The monthly job had however never run the last three months... I'll run it now.

[ Reply to This | # ]
are there only unix administrators here ?
Authored by: hamarkus on Jun 02, '03 01:55:41PM

Better than MacJanitor would be the simple perlscript found here ( http://theapotek.com/teknotes/archives/000012.html#000012 ) which checks every hour (or whatever you set it to) whether the scripts have been run or not, and if not runs them, completely automatically. Something similar with a GUI is Cronnix, already mentionned before: http://www.koch-schmidt.de/cronnix/



[ Reply to This | # ]