What convention do you use, or what conventions have you seen in other programs?
(It's for a research project)
What convention do you use, or what conventions have you seen in other programs?
(It's for a research project)
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.
All my backups have .bak appended to the original file name
MyDB.bak
MyTextFile.txt.bak
I simply copy the file to the same directory as the original and append ".bak"
the-original-file-name.bak
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.
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.
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.
There is an old UNIX convention of appending "~" to the filename. This is still popular on UNIX-like systems in use today.
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...
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.