Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was wondering when you guys have to backup a database or any directory in a server, what would be a good name to call them. For instance, database-2009-07-20.sql or directory_07_20_09.tar.gz

Is there any standard for this?

share|improve this question
add comment

4 Answers

up vote 10 down vote accepted

Usually the date (YYYYMMDD) for sorting and either the environment itself or the servername after the date. Putting the date first allows for quick sorting at the command line. You could also include whether the backup was a full or incremental backup so if need to do a restoration, you could easily find the last full backup and all the incrementals in between. So for example:

200920718_incr_prod_somedbserver01.tgz

200920719_incr_prod_somedbserver01.tgz

200920720_full_prod_somedbserver01.tgz

So something like this is my usual format. Again, there may be better alternatives, but the ideas are all fairly the same. I wouldn't be surprised if there were other ways to do this, but I find this methodology simple and easy to navigate.

YYYMMDD--full|incr--environment--servername|clustername?|virtualpool

share|improve this answer
1  
+1 - Embrace ISO-format dates! MM-DD-YYYY and DD-MM-YYYY are EVIL. –  Evan Anderson Jul 20 '09 at 14:54
add comment

I make sure to always include in the filename the date and time the backup was made. Just in case something happens on the filesystem such that the date and time are modified, such as copying the backup to some other medium.

share|improve this answer
add comment

I usually go with a name that has the db name and whether it is full, differential, or transaction (for SQL Server). Like database-full.bak.

share|improve this answer
add comment

It depends on what your process for rolling back is, if your rollback script/app requires a certain date format etc.

I prefer

bak.filename because then searches for ^filename only bring up current versions

whereas

filename.bak will show up in a search for ^filename

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.