Go Back   The macosxhints Forums > Working with OS X > OS X Developer



Reply
 
Thread Tools Rating: Thread Rating: 16 votes, 5.00 average. Display Modes
Old 05-04-2009, 03:27 PM   #21
kimpton79
Prospect
 
Join Date: May 2009
Posts: 41
A couple of years late but this might help some one searching for a solution. This will work for locally attached drives and with not work with network volumes though because usually you need to authenticate

Tools you will need

Composer by JAMF (best MAC OSX Admin package tool)

http://www.jamfsoftware.com/products/composer.php

Property List Editor

http://www.apple.com/downloads/macos...steditpro.html

A Test Machine (Test Test Test)

Things to do enable

root


1. Enable Auto Mount of drives even if no one is logged in

By default external drives will not mount to the file system until a user logs in. To get around this

Open Terminal and type the following

Sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutoMountDisksWithoutUserLogin true

Authenticate as root

Log into the machine as root
With Property List Editor open automount.plist located in /Library/Preferences/SystemConfiguration

Where AutoMountDisksWithoutUserLogin value is string change this to Boolen.

Save the changes, quit Property List Editor and restart the machine.

Test the volumes have mounted by opening Terminal and ssh to the machine

For example

username@ip address

Enter the password for the authenticated account

Type cd /Volumes/

Then type ls

The volumes should show mounted

2. Using Composer make a .pkg of the automount.plist you created above once done you can deploy this to a test machine using apple remote desktop

3. you can make a daily.local file by default Mac Osx has a daily weekly and monthly clean up scripts. The daily script takes place every day just after 3am. By creating a daily.local the system recoginises it has to do this script as well.


Open Terminal and type sudo su and enter the root password

Remember be very careful don't do this on your machine do it on a test machine!

type cd /etc/local/
type touch daily.local

this has created a daily.local in /etc/local/ but at the moment it is blank

in terminal type vi daily.local
press enter
press I for insert
(put your permissions and things you want to change in here)
press esc (to leave insert mode )
type :wq
press enter

Because you will not want to let people mess with the daily.local i would recommend set it as read only

in Terminal still as root chown root:wheel daily.local (This makes sure owner is root and the group is wheel)

Then type chmod 755 daily.local (This makes sure root only has Read and Write Access)

4. You will need to schedule the machine to startup at 3am and powerdown later depending on how long you want the machine powered on. I use workgroup manager and power off at 6am

5.You will need to test to see if the daily.local script will run

in terminal type sudo periodic daily

open console and you can see the daily.out in /var/log

You can use MacJanitor if you don't want to use terminal

http://personalpages.tds.net/~brian_...acjanitor.html

6. Using Composer make .pkg of the daily.local and push it out to a test machine using ARD

my daily.local looks like this

# Begin Repair Permissions Script
PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
export PATH
host=`hostname -s`
echo "Repairing Permissions on System Drive"
diskutil repairPermissions /
# End Repair Permissions Script

# Begin Sophos Sweep
echo "Starting Sophos Scan"
sweep / --quarantine
# End Sophos Sweep

# Set Softwarepdate Server xxx
defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL http://xxx.xxx:8088/index.sucatalog
# End setting Softwareupdate Server

# Begin Softwareupdate
echo "Starting Softwareupdate from xxx"
sofwareupdate -i -a
# End Sofwareupdate

hope this helps
kimpton79 is offline   Reply With Quote
Reply


Posting 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

Forum Jump



All times are GMT -5. The time now is 10:16 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.