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


Click here to return to the 'verbose unix features' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
verbose unix features
Authored by: lagroue on May 31, '03 04:00:11AM

Save some space, I guess ?

Or, more generally, considering that unix core is silently filling many hidden folders, most of them being useful for pure unix users, purpose could be calming down your mac if you're "only" a pure mac user.

BTW, my ~/Library/Logs contains a dozen crash logs, and is only 192Ko. Quite light compared to my /var/log directory : 55Mo...

My mac is now always running and never sleeps, so it can run its crontabbed archiving scripts every day, week and month, automatically saving space on my hard disk. (crontabbed archiving scripts are unix programs that gently sweep your mac's hidden unix corners).

I wonder how this sweeping can be done automatically if the mac is not running when these scripts are supposed to run ?

Any idea, somebody ? (admitting it could be at least as useful as getting rid of crash logs)



[ Reply to This | # ]
Sweeping
Authored by: Spartacus on May 31, '03 05:06:55AM

I installed anacron from fink. It works like crontab, except that if a job was not run at the given schedule because the Mac was sleeping or turned off, it runs it later when the Mac is on. I'd like to compile it without fink but I didn't manage it yet.

http://anacron.sourceforge.net/
http://sourceforge.net/projects/anacron



[ Reply to This | # ]
Sweeping
Authored by: bhines on May 31, '03 06:09:54PM

You have some objection to having your software easily upgraded, managed and removed, that makes you want to install it yourself instead of via fink? :)



[ Reply to This | # ]
Sweeping
Authored by: astrox on Jun 01, '03 01:18:28PM

As nice as that is, Ben, there are still some reasons for not using Fink. I sometimes want to install an executable to /usr/local/ or just /usr. It makes compiling other software easier when you don't have to set up $PATH and such to find the Fink header files and libraries. Abiword actually has a configure switch specifically to address this, but not every OSS package out there is so comprehensive.

And then there is the fact that Fink leaves not only the older files (/usr) in your system, but also leaves the source archive as well as the .deb to waste disk space. (Assuming you compile from the unstable tree, that is.)

I think Gentoo is a pretty good model for package management as well, but that doesn't get talked about much around here :)



[ Reply to This | # ]
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 | # ]