Maintenance Scripts not Running

I've just realized that my "daily, weekly, & monthly" scripts have only run once since buying this computer. That was a year ago. I use to have Anacron on my power pc to run them and it migrated from my old computer, but removed it shortly after following the uninstall instructions. I don't know if this had anything to do with the problem.

I ran all scripts manually in terminal and checked the Console log to verify that the scripts would work, and all ran fine. However, what am I missing that is not letting it run as designed on it own?
I know most will say it's not important and I don't really want to do it manually.

I just want to figure out how to get it to work without reinstalling OSX.

iMac Intel 21.5", Mac OS X (10.6.6), 8 Gig Ram

Posted on Feb 26, 2011 7:32 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 26, 2011 5:34 PM

ok, good 🙂

if 'disabled =1' for all three, then the following commands should change that, and subsequently they should show in the output of
sudo launchctl list | grep periodic which presumably they don't currently



sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.periodic-daily.plist


sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.periodic-monthly.plist


sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.periodic-weekly.plist
21 replies
Question marked as Top-ranking reply

Feb 26, 2011 5:34 PM in response to Glenn Leblanc

ok, good 🙂

if 'disabled =1' for all three, then the following commands should change that, and subsequently they should show in the output of
sudo launchctl list | grep periodic which presumably they don't currently



sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.periodic-daily.plist


sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.periodic-monthly.plist


sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.periodic-weekly.plist

Feb 26, 2011 10:07 AM in response to Glenn Leblanc

Something is either missing or corrupt. Either it's not checking when last run or a script to initiate checking and executing is missing. I just don't know what to look for and where.


Neither do I. You could do a reinstall, which in SL gives you new system files while leaving everything else in place. Though, I'd have a backup (preferably a bootable clone) to restore from in case (shouldn't be necessary, but you always want a backup anyway.) Then update using the 10.6.6 Combo.

Just as a generic step, first run Verify Disk and Repair Permissions from Disk Utility. Just guessing like you, but maybe uninstalling Anacron took something along with it. Or, maybe, the uninstaller missed something? EDIT: You could get EasyFind and search for any remnants. Enter "anacron," the name of the developer or anything else that might be connected.

http://www.devon-technologies.com/products/freeware/

EDIT: In Snow, the periodic scripts live in /etc/periodic. You can have a look there by using Go>Go to Folder from the Finder menu. You might then compare what you're seeing enclosed in the three folders, daily, weekly, monthly to what's on your wife's Mac. Anacron would have run the scripts from /etc/crontab I believe, which no longer exists. You shouldn't be seeing crontab there.

http://alastairs-place.net/anacron.html

See Kappy's instructions to uninstall Anacron.

http://discussions.apple.com/thread.jspa?threadID=2525803



Message was edited by: WZZZ

Message was edited by: WZZZ

Feb 26, 2011 4:40 PM in response to Glenn Leblanc

Nothing found in /etc/periodic on my computer and neither on my wife's computer that works...


that would be strange, since those scripts appear to be a standard 10.6 install, found in the BSD.pkg on the dvd - you're entering /etc/periodic/ into Finder-Go-Go to Folder and finding that Periodic is empty? or just the sub-folders?

more likely perhaps, is that the three periodic launchservices items were disabled at some point & this setting was migrated/imported. try this terminal command, which will not change anything... note the 'read' - we're just checking a plist.

sudo defaults read /private/var/db/launchd.db/com.apple.launchd/overrides com.apple.periodic-daily


your admin password will be required, and won't be echoed on screen as you type it.
if the result is Disabled = 1, that's at least one reason why it won't run.

Feb 26, 2011 7:45 AM in response to Glenn Leblanc

If you shut down at night, the scripts will never run. I believe they're set to run at 3:30 AM, or something like that. However, if sleeping, they are set to run on next wake up. If you want to shut down at night -- your choice -- then running the scripts manually every few days is ample. It's what I do. They aren't that important.

Running this command will give last time run information.

*ls -al /var/log/ .out

BTW, logs won't be rotated unless the computer is awake at 12:30 AM local time.

Feb 26, 2011 10:37 AM in response to leroydouglas

Yes, you're right. Good you caught that. Should be

ls -al /var/log/*.out

Can't explain how that happened. Was just copying and pasting that. I see now; it was the bolding that messed it up.




FWIW, here's my /etc/periodic

User uploaded file

-----------------------

Another idea: maybe a problematic system cache? Could try running Applejack.

http://sourceforge.net/projects/applejack/

http://reviews.cnet.com/8301-13727_7-10334620-263.html?tag=mfiredir



Message was edited by: WZZZ

Feb 26, 2011 7:55 AM in response to WZZZ

Thanks for the reply

I understand about scripts not running when computer is asleep. However, after a year they should have run at some point.
I bought another identical iMac for my wife 2 months ago. Her computer runs the scripts fine. They run every day, week, and month. Times shown vary depending on when she gets on it. It does not have to run at night. They should run after the time limit is up and next time computer is awoke from sleep. Her scripts run fine. Mine don't run at all.

As I said, I just ran them in terminal and they worked. They just don't work on their own as they should. They may not be important, but I just want to get them to work as designed.

Something is either missing or corrupt. Either it's not checking when last run or a script to initiate checking and executing is missing. I just don't know what to look for and where.

Feb 26, 2011 12:41 PM in response to WZZZ

I really was trying to prevent a reinstall, but will do if I can't figure it out. I'm even more curious as to why it doesn't work. I do have a bootable clone, but it is a copy and will be the same.

The old Anacron was redone to reside in Launch Daemons Folder and not cron.
Ran Permission repair, verified disk, uninstalled all Anacron files following all steps and also finder searching. No remnants found. In fact, I did follow Kappy's instructions last year when I uninstalled it.

Nothing found in /etc/periodic on my computer and neither on my wife's computer that works. Scripts are in >system>library>launch daemons folder. The files I can find (searching periodic) are the same on both computers and are in the same places. Mine doesn't work, the other does.

Here is a shot of what comes up with that terminal advise. It just shows what I have run today manually. I can't get it to give the complete log as you showed.

Glenns-Computer:~ glennleblanc$ ls -al /var/log/*.out
-rw-r--r-- 1 root wheel 671941 Feb 26 09:11 /var/log/daily.out
-rw-r--r-- 1 root wheel 1472 Feb 26 09:11 /var/log/monthly.out
-rw-r--r-- 1 root wheel 435 Feb 26 09:11 /var/log/weekly.out

I also check permissions on the files between the 2 computers and both are the same.

I should have mentioned that I have ran ONYX also. But before and after running it, the original scripts still show the first and only time files were executed right after buying the computer. That shows that the logs were never rotated. Only after running the scripts in terminal & ONYS is when I show a log rotation where the scripts have been run.

It seems to be whatever prompts the computer to check to see if they need to be run or the file that acutally executes the process. Either a file is missing or a script was changed or corrupted. Which one???
Looking for a way to check these out might be what's needed. I'm not a terminal user and have little understanding of it. So, be specific if suggestions include terminal usage.

Feb 26, 2011 1:29 PM in response to Glenn Leblanc

In addition:

After doing some more comparisons, I found one difference in the playlists between the 2 computers.
My finder search shows the file kind as a document. My wife's finder search shows the file as an OOPlist file. I realized that I didn't have OmniOutliner application anymore. I must have deleted it. I don't remember it coming with this computer. Her's does. Does this program come with OSX? Is it necessary to have it? Both files still show as playlist files (.plist extension).

This is the only difference I can find.

Feb 26, 2011 4:28 PM in response to Pondini

I never shut down my Macs, just sleep them. As I said, one computer works fine, mine doesn't run the scripts at all. In over a year, they were never run. My wife's computer runs them just fine. If they are running, the log files aren't showing it. Also as I've stated, I ran them manually with terminal and that worked fine.

I'm just on a mission now to find out why.

Feb 26, 2011 5:04 PM in response to andyBall_uk

Thanks for the reply

Actually putting the "/" in the search bar before any text clears the list. Just putting "periodic" in the search does bring up the folder in the list. I had to click on the folder in the list to open it up. I did find the files that way. It shows up with the subfolders: Daily Weekly Monthly folders and files in those folders as shown above.
That is the same on both computers.

OK. So I ran the terminal command and it does show disabled. How do I fix it and is there anything else we need to check.

Feb 26, 2011 5:35 PM in response to andyBall_uk

Andy, out of curiosity I ran that command and got

*Disabled = 0;*





Don't know what to make of that. Do you know if there is a "man" page for that?

AFAIK, my scripts will run if the computer is not shut down at night. I see there was another thread in which you posted around this issue and got to a solution.

http://discussions.apple.com/thread.jspa?threadID=2627793&start=0&tstart=0

EDIT: OK, I see. Disabled = 0 means they do run.

Message was edited by: WZZZ

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Maintenance Scripts not Running

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.