Safely updating Unix filesTim Bray provides Apple some instructions on how to update files containing important data (like iCal calendars). His directions are fine at a high level, but they're actually not quite detailed enough to implement from. So here's how you safely update Unix files:
(Add extra steps to taste if you want to keep more than one backup file.) The important bit, and the important difference, is the For shell scripts, this is: cp foo /etc/.newfile && \ cmp -s foo /etc/.newfile && \ ln -f /etc/foo /etc/foo.bak && \ mv -f /etc/.newfile /etc/foo sync I see a lot of shell scripts that leave out the I have omitted the step to synchronize permissions and ownership, because I don't know of a good utility to copy them from file A to file B. (2 comments.)
|
These are my WanderingThoughts GettingAround This is part of CSpace, and is written by ChrisSiebenmann. * * * Atom feeds are available; see the bottom of most pages. Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web |