Jump to content

keeping multiple backups of a file


Recommended Posts

Say you've got some file that you keep changing over and over. You want to save some backup copies but there's no need to save every single one for all eternity. Maybe you want to keep everything less than a week old, then keep another from a month or so ago, then another from 6 months, then another from a year or so ago - for instance.

Or maybe something else. What other ways of managing the backlog of backups make good sense? (Besides the obvious methods, keep everything, or keep nothing.)

Here's what I wrote that does what I just described, for what it's worth. I already want to add one feature to it, which is to keep at least N backup files, no matter what. Where N is the number of "ages" to keep (3 in the above example). LV 8.0.

http://forums.lavag.org/index.php?act=attach&type=post&id=6777http://forums.lavag.org/index.php?act=attach&type=post&id=6778

Link to comment

I didn't look at the code, but I would probably create a folder for each backup with a formatted timestamp as part of the folder name. Then, whenever you do a backup, you also go over the list of existing backups and delete all the folders which are older than N.

Link to comment

QUOTE(yen)

I didn't look at the code, but I would probably create a folder for each backup with a formatted timestamp as part of the folder name. Then, whenever you do a backup, you also go over the list of existing backups and delete all the folders which are older than N.

Pretty much what I'm doing, except I timestamp the filenames not folders, and I do keep selected files older than N.

QUOTE(NormKirchner @ Aug 29 2007, 01:42 AM)

Am I stating the obvious, but what about source code control? It does go the 'everyting' route, but I know for sure that Perforce optimizes the different versions so it does not necessarily save the entire file for each version.

Not obvious at all (or maybe I'm just slow). But this means I'd have to start using source code control - probably a desperately needed idea even without this side-benefit... Thanks for the suggestion.

Link to comment

QUOTE(torekp @ Aug 29 2007, 06:59 AM)

But this means I'd have to start using source code control - probably a desperately needed idea even without this side-benefit...

It really is worth it. As a side benefit, everything that you source code control can usually be backed up with calls to the source code control program. For SVN you can use the concept of a "hot copy" to back up all of the data in your source code control repository to another path.

Link to comment

QUOTE(chrisdavis @ Aug 29 2007, 08:46 AM)

It really is worth it. As a side benefit, everything that you source code control can usually be backed up with calls to the source code control program. For SVN you can use the concept of a "hot copy" to back up all of the data in your source code control repository to another path.

Query: Has NI Week ever had a presentation on using source code control with LabVIEW? It seems to come up as a topic of conversation regularly, and perhaps NI should have a presentation in the library for sales folks to be able to present on this topic. Would that be a good topic to suggest for next year?

Link to comment

I was thinking of SCC as well, although that doesn't conform to the exact specs and it requires some overhead. However, if this is for your own code, you should definitely use it. We also use SVN with TSVN for the interface and the greatest benefit so far is the ease of synchronization. Getting the changes other developers made requires two (yes, two) mouse clicks and waiting a few seconds.

QUOTE(Aristos Queue @ Aug 29 2007, 04:50 PM)

Would that be a good topic to suggest for next year?

It probably would, but it would depend on what your target audience is. I'm fairly sure Brian Powell's presentation about NI's software engineering practices and Jim Kring's presentation about commercial software apps discussed this topic (I'm sure Jim can correct me if I'm wrong).

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.