SNAPSHOT        Take a “snapshot” of the local PC file system

Top  Previous  Next

Syntax:

SNAPSHOT

[ filename ] [ dbfile ] [ /options ]

Arguments:

[ filename ]

Optional variable or string defining a wildcard pattern or file name. The snapshot database will only contain rows for files in the current working folder that match this filename or wildcard pattern.

 

[ dbfile ]

Optional variable or string defining an alternate name for the database file used to save the snapshot.  If no value is specified “snapshot_local.sql” is used by default.  If a file name is specified with no folder, the Robo-FTP program directory is used.  An error will occur if the file name contains invalid characters or if a folder is specified with no file name.

Options:

/incldirs

Search all sub-folders of the current working directory for files matching the [ filename ] argument.

 

 

This script command is used in conjunction with the DIFF and GETDIFF script commands to locate individual file differences (i.e., change in size, date/time stamp) within the current working folder (and optional subfolder tree) of the local PC file system.

 

SNAPSHOT is the first step to establish a baseline (or “snapshot”) you can later use to determine if any files changed.  Details about files in the current directory that match the [ filename ] argument are saved in an SQL database file.  The database file name defaults to “snapshot_local.sql” but you may name it anything you like via the [ dbfile ] argument.

 

As long as unique and consistent [ dbfile ] arguments are specified, Robo-FTP supports as many separate snapshots as you wish.

 

Consider the following example which takes a snapshot of all files in the current working folder and any subfolders.

 

SNAPSHOT "*" /incldirs

 

In most cases SNAPSHOT need only be run once. Future changes detected by the DIFF command are automatically updated in the database by default.

 

The total number of files examined in the local PC file system is saved in the %snapshotfiles script variable.

 

The internal variable %currentlocaldir contains the name of the current working directory and the WORKINGDIR command may be used to change the current working directory.

 

The FTPSNAPSHOT command provides similar functionality for remote servers.

 

Related Command(s): DIFF, GETDIFF, DIFFREWIND

See Also: FTPSNAPSHOT