piartool -backup command options
- Last UpdatedMay 02, 2025
- 5 minute read
- PI System
- PI Server
Use the -piartool - backup command to back up specific Data Archive components, archives, or the entire system.
The command requires a backup path as the first argument immediately after -backup, which specifies the destination folder for the backup files. The path can be a local directory (for example, C:\pi\backup) or a UNC (Universal Naming Convention) path (for example, \\server\share\pi\backup)
Note: Mapped network drives are not supported, and while UNC paths are allowed, they are not recommended due to potential reliability issues.
For example, this command performs a full backup and places the files in the backup folder.
piartool -backup C:\pi\backup -type FULL
This table describes the available command-line options (flags) that can be used with the -piartool - backup command.
|
Options |
Description |
|
-arcdir |
Back up archives and annotation files to the path\arc directory. If this option is not specified, archives are backed up to a directory based on their current location. For example, if an archive is in the C:\PI\archives directory, then it is backed up to the directory. Similarly, if an archive is in the C:\PI\dat directory, then it is backed up to the path\dat directory. |
|
-archive n0 n1 n2 |
Back up the archive or archives specified by n0, n1, n2, and so on. The annotation file associated with the specified archive is also backed up. Archive numbers begin at 0 with the primary archive. For example, the following command backs up the primary archive and archive 2:
|
|
-component c0 c1 c2 .. |
Back up the component or components specified by c0, c1, c2, and so on. For example: piartool -backup c:\pi\backup -component pibasess This command backs up only the files that belong to PI Base Subsystem. The -archive and -component flags can be used in conjunction with each other. For example, the following command backs up the pibasess, pisnapss, and piarchss components in addition to the primary archive: piartool -backup c:\pi\backup -component pibasess pisnapss piarchss -archive 0 To see a full list of components, type: piartool -backup C:\pi\backup -identify -verbose |
|
-cutoff date |
Cutoff date in PI time format. Restricts the backup to archives that contain data between 10 days prior to current time and current time. The more restrictive of -numarch N and -cutoff date take precedence. The default cutoff date is 1-Jan-1970 00:00:00, unless otherwise specified by the Backup_ArchiveCutoffDate timeout parameter. This flag is ignored if the -component or -archive flag is specified. If -cutoff date is specified for an incremental or differential backup (-type INCREMENTAL or -type DIFFERENTIAL), then all modified archives and all archives matching the cutoff date criteria are included in the backup. The -cutoff flag has no effect on a full backup. Note: The-cutoff date option works only with INCREMENTAL and DIFFERENTIAL backups. It includes all modified archives and any that contain data after the cutoff date. It has no effect when you run a FULL backup. |
|
-exclude c0 c1 c2 |
Exclude the component or components specified by c0, c1, c2, and so on. |
|
-excludeArchivesWithEndTimesOlderThan EndTime |
Exclude archives with end times older than the specified date. This command is typically used with incremental backups. |
|
-excludeFuture |
Exclude future data archives from backups. |
|
-identify |
Display the files that would be backed up, without actually performing the backup. This option is useful for verifying which files will be included before initiating the backup. It can be combined with other options such as -type,-component, - verbose, and -archive to preview specific subsets of backup content. This command lists all the files that would be included in a COPY backup, without creating the actual backup. piartool -backup -identify -type Note: You do not need to specify a backup file. The -identify option previews which files included in the backup and writes the list to the command prompt window. |
|
-numarch N |
Backs up N archives. For example, specifying -numarch 2 backs up the primary archive and archive 1, provided that archive 1 contains data. The default number of archives for backup is 3, unless otherwise specified by the Backup_NumArchives timeout parameter. Note: Empty archives are never backed up. Specifying -numarch -1 includes all archives that contain data (and that are not excluded with the -exclude flag) in the backup. Specifying -numarch 0 excludes all archives from the backup. This flag is ignored if the -component or -archive flag is specified. If -numarchN is specified for an incremental or differential backup (-type INCREMENTAL or -type DIFFERENTIAL), the first N archives plus any other archive that has been modified are included in the backup. The -numarch flag has no effect on a full backup. |
|
-type type |
Specifies the type of backup to perform: , , or .
|
|
-verbose |
Increases the level of detail in the output and is typically used with -identify. Displays detailed information such as exact paths and component names to be backed up. This command lists all the files the system would include in a backup, with detailed file paths and component information, but does not perform a backup. piartool -backup -identify type COPY -verbose You can also use -verbose with type FULL.This command performs a full backup to D:\pi\server\backup and displays detailed output on the console. piartool -backup -type FULL -path "D:\pi\server\backup" -verbose |
|
-wait [sec] |
Waits up to the specified number of seconds for the backup to finish before the piartool -backup command returns. The progress of the backup is reported every 15 seconds. When the backup is complete, a summary of the backup is reported. If you use the -wait flag without specifying the sec argument, then piartool -backup waits up to one day for the backup to complete. If you do not specify the flag, then piartool -backup returns immediately. In this case, you can monitor the progress of the backup with piartool -backup -query. The -wait option is used in the pibackup.bat script because it is important for the backup to complete before the site-specific backup scripts are called. |