Here a little shell script I wrote for easily switching from one Mac to another, or from one system to a new one. Sure, it is possible to use Carbon Copy Cloner or Apple's Software Restore, but these tools will copy all the stuff from one machine to another ... and sometimes, it is good to start with a clean state.
So you have to copy the data in /Users, but there are some other little configuration files that take a long time to customize. So here is a script to handle those items. What does it do? A folder is created, named with the current date. The Apache configuration files, the FTP files, the SystemConfiguration files, and the the crontab are copied to this folder.
How to launch it? Open Terminal, and type sh /path/of/the/script. Make sure you've made it executable first (chmod 755 script_name from within the script's directory).
#!/bin/sh
# Allow switching from one mac to another
# v0.1
# g.durr.removethis@free.fr
#
cd "`dirname "$0"`"
mpath=`date`
mkdir "$mpath"
cd "$mpath"
#---------- APACHE ----------
mkdir http
cp /etc/httpd/httpd.conf ./http
cp /etc/httpd/mime.types ./http
cp -R /etc/httpd/users ./http
#---------- GENERAL ----------
cp -R /Library/Preferences/SystemConfiguration .
cp /etc/ftpusers .
cp /etc/hostconfig .
echo $PATH > ./PATH
#---------- CRONTAB ----------
mkdir crontab
cp -R /etc/crontab ./crontab/
crontab -l > ./crontab/`whoami`
#---------- INFO STARTUPITEM ----------
ls -lisa /Library/StartupItems/ > ./Info_startupitem
Let me know if anybody wants to improve it. It would be great if it was as complete as possible.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20040329150916121