Backups

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Backups

Ian Bartholomew
Here's a nice easy one that you might find of use if you have got plenty of
disc space. It automatically backs up _every_ package you save allowing you
to recover should you inadvertently overwrite the "proper" pac file on your
disc (yea, alright - I admit it <g>). I know this has been mentioned before
but this does seem a reasonably useful and transparent way to do it and is
not reliant on what you do whilst within Dolphin - my overwrite was done at
the OS level.

After installing, every time you save a package a copy is made in a backup
folder created directly below the folder the package is being saved in. So
if you save

c:\aPath1\aPath2\aFilename.pac

it will create a folder (if needed) and save

c:\aPath1\aPath2\backups of aFilename\nnnnnnn.bacpac

where nnnnn is the number of seconds elapsed since Queen Victoria died (or
something).

That's all it does. If you want to reuse one of the backup packages you will
have to copy and rename it yourself. You should also keep an eye on the disc
space used by the backups. Hint: If you do a Windows file search using the
following then it finds all the backup folders, which can then be expunged
in one go.

backups?of*

Modify the following method so that the last two lines read
Package>>savePac
[...]
    self bacpac.
    ^true

Add
Package>>bacpac
bacpac
    | folder |
    folder := File
        composePath: (File splitPathFrom: self packageFileName)
        subPath: 'backups of ', (File splitStemFrom: self packageFileName).
    File createDirectory: folder.
    File
        copy: self packageFileName
        to: (File
            composePath: folder
            stem: Time totalSeconds printString
            extension: 'bacpac')

Ian