----^--->
/\

//\\
//The\
/Sy
stem\
////
Guard
\

In the mount of the LORD it shall be seen. Genesis 22:14

Snapshot

Booming Or Fuming? | MasterCatalog | ntlib (FREE) | NTCmdLib | MtCmds | Scripts | Almost Free | TheGuardBook | Help

 

Scripts  
Snapshot .cmdHelp OutLine .cmdSrc .cmd :HEADER :PRELIM :SETUP :WORK :VERIFY :NOTIFY :FINISH :ERROR

Snapshot (create a copy when a file changes)

Description

Creates a date and time prefixed SNAPSHOT backup, at specified intervals, when a file has changed.  Snapshot is perfect for watching critical files.  It is especially useful when writing scripts or other programming code.  Source code files can be watched and snapshots made as frequently as every 1 minute!

Remember the rule
for saving your work:

  Make a backup copy whenever you've done
more work than you want to do over!!!

Syntax

 Advanced (FREE) scripts are prefixed "TSG_" and Expert ("Almost Free") versions begin with "!"

 

Example Syntax Chart

  Requirements
TSG_SNAPSHOT [/?] [drive:][path]FileToProtect [SafeLocation]
[Interval]
  NT-based Operating System
ntlib 2004.03.28 or later
       
!SNAPSHOT [/?] [/C] [/DEMO] [/FP] [/NV] [/P] [/WF]
[drive:][path]FileToProtect [SafeLocation]
[Interval] [Warning_Trigger] [Error_Trigger]
[MaxSnaps] [MaxTime]
  NT-based Operating System
NTCmdLib 2004.03.28 or later

Parameters and Switches

    Defaults are shown in { }'s; Shaded indicates switch or parameter is available only in the Expert Version

/? -or- /Help   Display help screen.
/C   Compact window during run (size restored at Final Report). {off}
/DEMO   Show the PCLS Demo. {off}
/FP   FullPath (use the full path of FileToProtect in window title) {name.ext}
/NV   NoVisual (don't change console colors to reflect operating status) {on}
/P   Pause (pause console after Final Report) {off}
/WF   WaitforFile (bypass error if FileToProtect does not exist) {off}
FileToProtect   A SINGLE file to protect (no wildcards!)
SafeLocation   Folder to hold snapshots {c:\!snapshot}
Interval   Minutes between file checks {5}
Warning_Trigger   Consecutive missed snapshots before warning. {1}
Error_Trigger   Consecutive missed snapshots before error. {2}
MaxSnaps   Maximum snapshots to take before stopping. {25}
MaxTime   Maximum time (in minutes) to wait. {480} (~8 hours)

Errorlevels, Output Variables and Custom Mount/\Commands

ErrorLevel

 

Description/Contents

0

  Normal or expected finish.

1

  Help screen was displayed.

2

  Script exited with a specified error.  See %ErrorMsg% for details.

3

  Script exited with an unspecified error.

 

Variable Name

 

Sample Value

  Description/Contents

ErrorMsg

 

"Error Message"

  The text of an error message which caused the script to exit

Examples, Notes and Instructions

  • The SafeLocation folder will be created if needed.
  • The Interval time is NOT PRECISE, and can overshoot by several seconds, depending upon system load.
  • MaxTime refers to wait time only. Time spent comparing and copying files DOES NOT count.
  • If any optional parameter is used, all optional parameters to it's left must also be specified.

For example, to specify MaxSnaps, you must also specify SafeLocation, Interval, Warning_Trigger and Error_Trigger.

Example 1 - Interactively, at the command prompt, library not loaded before !Snapshot

NT
2K
XP
K3
C:\GuardPost>!snapshot
  ^   =========================================================================
 /!\    SnapShot Expert Release 2004.04.24 ("Almost Freeware" at $9 or less)
/CMD\ =========================================================================

Create a snapshot backup when a file changes.
_______________________________________________________________________________

!SNAPSHOT [/?] [/C] [/DEMO] [/FP] [/NV] [/P] [/WF] [drive:][path]FileToProtect
          [SafeLocation] [Interval] [Warning_Trigger] [Error_Trigger]
          [MaxSnaps] [MaxTime]

SWITCHES: Default values are shown in {}'s
 /?    Display this help.
 /C    Compact window during run (size restored at Final Report). {off}
 /DEMO Show the PCLS Demo. {off}
 /FP   FullPath (use the full path of FileToProtect in window title) {name.ext}
 /NV   NoVisual (don't change console colors to reflect operating status) {on}
 /P    Pause (pause console after Final Report) {off}
 /WF   WaitforFile (bypass error if FileToProtect does not exist) {off}

PARAMETERS: Default values are shown in {}'s
 FileToProtect     A SINGLE file to protect (no wildcards!)
 [SafeLocation]    Folder to hold snapshots {c:\!snapshot}
 [Interval]        Minutes between file checks {5}
 [Warning_Trigger] Consecutive missed snapshots before warning. {1}
 [Error_Trigger]   Consecutive missed snapshots before error. {2}
 [MaxSnaps]        Maximum snapshots to take before stopping. {25}
 [MaxTime]         Maximum time (in minutes) to wait. {480} (8 hours)

The SafeLocation folder will be created if needed. The Interval time is
NOT PRECISE, and can overshoot by several seconds, depending upon system
load. MaxTime refers to wait time only. Time spent comparing and copying
files DOES NOT count.

If any optional parameter is used, all optional parameters to it's left must
also be specified.

For example, to specify MaxSnaps, you must also specify [SafeLocation],
[Interval], [Warning_Trigger] and [Error_Trigger].

------------------------------------------------------------------------------

For the latest information, see (http://TheSystemGuard.com/Scripts/Snapshot)
_______________________________________________________________________________

!SNAPSHOT [/?] [/C] [/DEMO] [/FP] [/NV] [/P] [/WF] [drive:][path]FileToProtect
          [SafeLocation] [Interval] [Warning_Trigger] [Error_Trigger]
          [MaxSnaps] [MaxTime]

C:\GuardPost>!snapshot SysGuard.cmd c:\!snapshot 1
[Tue 03/30/2004 16:20:09] Snapshot Taken. {1}
[Tue 03/30/2004 16:20:09] Waiting 1 minute(s)...
[Tue 03/30/2004 16:21:11] Snapshot current. {1}
[Tue 03/30/2004 16:21:11] Waiting 1 minute(s)...
[Tue 03/30/2004 16:22:12] Snapshot current. {2}
[Tue 03/30/2004 16:22:13] Waiting 1 minute(s)...
[Tue 03/30/2004 16:23:14] Snapshot current. {3}
[Tue 03/30/2004 16:23:15] Waiting 1 minute(s)...
[Tue 03/30/2004 16:24:16] Snapshot current. {4}
[Tue 03/30/2004 16:24:16] Waiting 1 minute(s)...

{!Snapshot would continue monitoring for the default time
 of 8 hours since no MaxTime or MaxSnaps was specified.}

Scripts  
Snapshot .cmdHelp OutLine .cmdSrc .cmd :HEADER :PRELIM :SETUP :WORK :VERIFY :NOTIFY :FINISH :ERROR

/\
//\\
//
The\
/Sy
stem\
////
Guard
\
COME ON UP WITH US!
and
Congratulations On Your Decision
to
RISE ABOVE
THE REST!

^
/
!\
/LIB\

TheSystemGuard.com [Revised: 2007-03-29]
Copyright © 1995-2007, JWC
Computer Communications,
All Rights Reserved, Worldwide.
 Disclaimer       Privacy       About Us       More


Communication Is Business!

We Master It With Knowledge!

^
/
.\
/M^C\