Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > how do you run the cron "cleaning" from terminal?

how do you run the cron "cleaning" from terminal?
Thread Tools
Grizzled Veteran
Join Date: Oct 2001
Location: Michigan
Status: Offline
Reply With Quote
Feb 21, 2005, 08:20 PM
 
Just out of curiousity what would I have to type in from the terminal?
Pismo 400 | Powerbook 1.5 GHz | MacPro 2.66/6GB/7300GT
     
Mac Elite
Join Date: Jan 2003
Location: 127.0.0.1
Status: Offline
Reply With Quote
Feb 21, 2005, 08:23 PM
 
Daily: sudo /etc/daily
Weekly: sudo /etc/weekly
Monthly: sudo /etc/monthly
     
tkmd  (op)
Grizzled Veteran
Join Date: Oct 2001
Location: Michigan
Status: Offline
Reply With Quote
Feb 21, 2005, 09:16 PM
 
Thanks- does Mac os x do these commands during bootup? or do they just accumulate ?
Pismo 400 | Powerbook 1.5 GHz | MacPro 2.66/6GB/7300GT
     
Mac Elite
Join Date: Jan 2003
Location: 127.0.0.1
Status: Offline
Reply With Quote
Feb 22, 2005, 04:28 AM
 
Originally posted by tkmd:
Thanks- does Mac os x do these commands during bootup? or do they just accumulate ?
Nope. The daily script runs daily at 3:15 AM. The weekly script runs on Saturday at 4:30 AM. The monthly script runs on the 1st of the month at 5:30 AM.

Mac OS X inherits the original BSD subsystem code where it was assumed that these machines were never shut off. If the machine is off during those times the script will NOT run and databases do not get backed up.

You can either run these scripts through the terminal or through the GUI by using the freeware utility OnyX.


Here are the details about each script courtesy of OnyX help:

- Daily script: This script (daily) removes scratch and junk files (/tmp, /var/tmp, and /var/rwho), backs up the NetInfo database, checks subsystem status, and rotates the System.log file. By default, this script is executed every day at 3:15 AM, if the computer is turned on.


- Weekly script: This script (weekly) rebuilds the Locate and Whatis databases, restarts the Syslog process, and rotates the ftp.log, ipfw.log, lookupd.log, lpr.log, mail.log, and netinfo.log files, and the access_log and error_log files in the httpd folder. By default, this script is executed every Saturday at 4:30 AM, if the computer is turned on. This operation might take a few minutes; please be patient...


- Monthly script: This script (monthly) restarts the syslog daemon, runs login accounting, and rotates the wtmp.log and install.log files. By default, this script is executed the first day of every month at 5:30 AM, if the computer is turned on.
     
tkmd  (op)
Grizzled Veteran
Join Date: Oct 2001
Location: Michigan
Status: Offline
Reply With Quote
Feb 6, 2008, 12:30 PM
 
I hate to bring an older topic back from the dead, but is anyone else having problems imputing these cron scripts in leopard - they worked beautifully in tiger...
Pismo 400 | Powerbook 1.5 GHz | MacPro 2.66/6GB/7300GT
     
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Offline
Reply With Quote
Feb 6, 2008, 01:17 PM
 
Many internal components changed rather drastically in Leopard. What problem are you having?

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
tkmd  (op)
Grizzled Veteran
Join Date: Oct 2001
Location: Michigan
Status: Offline
Reply With Quote
Feb 6, 2008, 01:19 PM
 
I just wanted to run these commands in leopard via the command line - instead of downloading a separate program (onyx,machelper etc) and run these option through them...
Pismo 400 | Powerbook 1.5 GHz | MacPro 2.66/6GB/7300GT
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Feb 6, 2008, 01:25 PM
 
The problem with cron which is solved by both anacron and launchd is that these jobs have to run at these absolute times. With anacron and launchd you can have tasks run after a certain interval of time. I'd look for any maintenance scripts to be moved to launchd in Leopard. Try a:

sudo launchctl list
     
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Feb 6, 2008, 04:08 PM
 
Originally Posted by tkmd View Post
I just wanted to run these commands in leopard via the command line - instead of downloading a separate program (onyx,machelper etc) and run these option through them...
The executable /usr/sbin/periodic is still there,
as are the task folders inside /etc/periodic. So...

sudo periodic daily weekly monthly

should still "work".

But besson3c is right. The best way to run them (imho)
is by giving launchd a kick in the pants:

sudo launchctl start com.apple.periodic-daily
sudo launchctl start com.apple.periodic-weekly
sudo launchctl start com.apple.periodic-monthly

As before, we can get an idea of how up-to-date they are with:

ls -lhrtT /var/{log/*.out,db/locate.database}
-HI-
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:40 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2