One way to help back up personalized system files

Mar 29, '07 07:30:01AM

Contributed by: PhilMarshall

It seems like every time I backup my home folder and then do an erase and install, I forget a bunch of system files: my hosts file, apache, mysql, and php config files. So I've come up with a handy solution. I've created a folder in my home folder, ~/.system. In that folder, I've created hard links to a bunch of system files:

hosts -> /etc/hosts
httpd.conf -> /etc/httpd/httpd.conf
my.cnf -> /etc/my.conf
sites.conf -> /etc/httt/sites.conf
You create a hard link in Terminal using this syntax, assuming you're in the directory where you'd like the link to be created:
$ cd ~/.system
$ ln /etc/hosts .
A hard link creates two directory entries pointing to the same file on the disk. Deleting one directory entry doesn't delete the file. Now when I back up my home folder, I also back up these personalized system files.

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070327080600596