views:

196

answers:

10

What convention do you use, or what conventions have you seen in other programs?

(It's for a research project)

A: 

I'm assuming you mean temporary savefiles, in which case it's whatever mktemp gives me.

If you're talking about backing up code… well, use version control.

Ben Alpert
+2  A: 

All my backups have .bak appended to the original file name

MyDB.bak
MyTextFile.txt.bak
MrTelly
A: 

I simply copy the file to the same directory as the original and append ".bak"

the-original-file-name.bak

Daniel Gill
+2  A: 

I generally like to retain a date/timestamp in the filename. e.g. yyyymmddhhmmss-whatever Makes it easier to track back to a particular backup.

David Dekker
A: 

I generally don't have a need to backup individual files. I tend to back up folders. When I do I zip the folder and name the zip: [folder name]_yyyyMMdd

If the time of the backup is important, I tack on _hhmm (based on 24 hour clock).

This way my backups (which are kept in the same folder) sort by date created in Windows Explorer.

Jay Riggs
+1  A: 

Like previous posters stated, this depends on the purpose of the backup file. Oneshot-Editing/Processing: mktemp, keeping a 'working' version while fiddling around with a configuration file that is for some reason not in version control: renate to file.bak, anything else: version control.

Jan Jungnickel
+1  A: 

There is an old UNIX convention of appending "~" to the filename. This is still popular on UNIX-like systems in use today.

Michael Trausch
+1  A: 

I use a similar standard as I learned from DNS SOA record ids -

filename.ext-yyyymmddxx

Todays' first backup then would be filename.xt.2009030601

It has the effect of sorting in the right order in a directory listing...

DGM
+1  A: 

OriginalName-mmddnn.OriginalExtension

nn = 1,2,3, ... infinity (or as close to 99 as it gets)

I never put year inside the date, since I usually don't work on Old Year's Eve, nor on the New Year. And to look at it the rest of the year ... uhmm ... no.

ldigas
A: 

Most of the time I use:

$FILENAME.bak-$(date +%Y%m%d%H%M%S)
Jeremy Cantrell