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


Click here to return to the 'Edit crontab for basic utilities in a business setting' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Edit crontab for basic utilities in a business setting
Authored by: sheurich on Feb 11, '05 03:20:47PM

The lines that read :

15 16 * * 4 root plutil -s ~/Library/Preferences/*.plist
30 16 * * 4 root plutil -s /Library/Preferences/*.plist

should be changed. The first line uses ~, which expands to /private/var/root, since this is being run by root - assuming you are trying to check your own Preferences you will want to replace this by ~username.

A more complete solution would be :

15 16 * * 4 root find /Library/Preferences /Users/*/Library/Preferences -name \*.plist -exec plutil -s {} \;

This will check the local system's library as well as all local users' libraries for proper syntax of property lists.

To add root's library as well (which is probably not necessary, unless you are logging in to the console as root) :

15 16 * * 4 root find /Library/Preferences /Users/*/Library/Preferences /private/var/root/Library/Preferences -name \*.plist -exec plutil -s {} \;



[ Reply to This | # ]
Edit crontab for basic utilities in a business setting
Authored by: thornezilla on Feb 11, '05 06:49:08PM

Thanks for the correction -- yes, having plutil check the "~/Library" doesn't do a whole lot of good since it fails to check any of the users' Preferences directories. The system crontab is being run as root while the computers are either showing the login screen, or logged-in as various non-Admin users.

What our local UNIX guru pointed out to me is that running the plutil in this fashion doesn't do much good, as any failures are not visible to the users and generate no reports.

He suggests that I have any failures trigger an AppleScript that removes the offending plist files. At the very least, errors need to call a dialog box up to let the user know that there is a damaged pref file at location: "Users/xxxx/Library/Preferences/xxxx.plist".



[ Reply to This | # ]
Edit crontab for basic utilities in a business setting
Authored by: DanFrakes on Feb 13, '05 02:05:39AM

"The system crontab is being run as root while the computers are either showing the login screen, or logged-in as various non-Admin users."

To be clear, the system crontab is *always* run as root -- even if an admin user is logged in.


"What our local UNIX guru pointed out to me is that running the plutil in this fashion doesn't do much good, as any failures are not visible to the users and generate no reports."

Right. You can mail the results or even pipe them to a text file on a server or to a particular account's Desktop. This way an admin or the user, respectively, could check the outputs for problems.



[ Reply to This | # ]