- Use a unique file name.
If you’re creating a file, say a tar archive or a db dump, there’s always the possibility that you can overwrite your file with a slight misstate on the keyboard, this is why you should use a unique file name.- In BASH use the $RANDOM variable, for example:
tar -jcvpf website-$RANDOM.tar.bz2 /usr/www/website - In other shells use date:
pg_dump -U pgsql website > website-`date "+%Y%m%d%H%M.%S"`.psql
or, alternatively:DATE=`date "+%Y%m%d%H%M.%S"`;tar -jcvpf website-$DATE.tar.bz2 /usr/www/website
- In BASH use the $RANDOM variable, for example:
- Enable transaction logging.
- Do a backup before you ‘drop db‘:
- pg_dump
- mysqldump
- Start with a dry run.
- Before you run a command that could possibly alter data, try a test run on some sample data:
- In Subversion you can use –dry-run.
- tar has a dry run feature.
- scp does too.
- Peer review, validation, or some form of agreement that “it will work” before deployment.
- Make sure you have an email account outside of the corporate server for testing. (Gmail, Yahoo, Hotmail, etc)
- Make sure you have a shell to test from outside of your network.
- Don’t assume that error message is going to be there when you reboot.
- Thou shall not move a cable to a new port without checking the config of both ports first. (contributed by stew)
- Try to do as much as you can as yourself, without su.