Restore Command

The Restore Command

  • restore <key> [-ver <date-spec>] [<share-opts>]
    rest <key> [-ver <date-spec>] [<share-opts>]
     
    where:
    <date-spec>
    :=
    <relative-ver> | <date-ver>
    <relative-ver>
    :=
    a negative number, e.g. -1
    <date-ver>
    :=
    <mmddyy>[.<vv>]
    <mmddyy>
    :=
    a date string, e.g. 021715
    <vv>
    :=
    a two-digit version number, e.g. 04
    <share-opts>
    :=
    -share | -sh | -noshare | -nsh | -servloc
    • Restores the local copy of the files of the key to the requested date and incremental version that was backed up onto the server.
    • (NOTE: The 'restore <key>' command is shorthand for 'get <key> -restore'.)
    • If the '-ver' option is not specified, restores the local copy to match the current 'Main' server copy.
    • If the '-ver' option is specified, restores the local copy to a version prior to the last one saved.
    • There are three different ways to specify the target <date-spec> version:
      1. As a relative version from the latest, expressed as a negative number, where '-1' would be the version just prior to the current, '-2' would be the one before that, and so on. This specification format is the easiest to use, and is useful for just reversing the changes for a version or two.
      2. As a version saved on a specific date without a specific version number. This will restore to the final version saved for that date.
      3. As a version saved on a specific date with a specific version number. This will restore to any date that was saved, and any incremental version on that date. This format is more difficult to use, because one must first see what versions were saved by looking at the 'Backup' and 'Incremental' directories first. (This can be done via the gobak <key> and goinc <key> commands, respectively.)
    • EXAMPLES
      • Restoring local version of key 'vi' to the Server current version:

        rest vi

      • Restoring local version of key 'vi' to the version saved just before the current one:

        rest vi -ver -1

      • Restoring local version of key 'vi' to the version saved two saves ago:

        rest vi -ver -2

      • Restoring local version of key 'vi' to the version saved as '021715.04':

        rest vi -ver 021715.04

  • How a version is stored on the server
  • The 'backup' command copies the files being backed up to three locations on the server:
    1. Each individual backup action puts a copy of that transaction in the 'Incremental' backup server directory, as compressed files by default.
    2. The changes of the individual backup action are added to the set of changes in the 'Daily' backup server directory, as compressed files by default. If a full backup is not being done, the stored filename for the backup will be in the form '<date-str>[.<checkpoint-name>].Delta.zip' to mark the file as an incremental or 'delta' backup. Full backups have the same form, but without the '.Delta'.
    3. The files that changed in the individual backup action are copied to the 'Main' backup server directory. This directory contains the full current image for the key, and the files are uncompressed by default.
  • How a version is restored from the server
  • The operation to reconstruct a specific date and version of a key involves the following steps:
    1. Find the last full backup stored in the 'Daily' server location that has a date on or before the restore date. This will be a file that does not have '.Delta' in the filename.
    2. Copy the files of the full 'Daily' backup to a temporary location.
    3. Apply the changes in the 'Daily' server location that have a later date stamp than the full one one-by-one until the target date has been reached.
    4. Apply the changes in the 'Incremental' server location whose date stamps match the target date one-by-one until the target version number has been reached.
  • Once the version has been reconstructed, the user is prompted whether to replace the local copy of the files of a key with the reconstructed version. If the user says yes, the files are then copied to the local location.
Previous: Diffkey Command Next: Get Command