Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Save (SAV) command saves a copy of one or more objects that can be used in the integrated file system.
For more information about integrated file system commands, see the Integrated file system topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
DEV | Device | Values (up to 4 repetitions): Path name | Required, Positional 1 |
OBJ | Objects | Values (up to 300 repetitions): Element list | Optional, Positional 2 |
Element 1: Name | Path name, * | ||
Element 2: Include or omit | *INCLUDE, *OMIT | ||
PATTERN | Name pattern | Values (up to 300 repetitions): Element list | Optional |
Element 1: Pattern | Character value, * | ||
Element 2: Include or omit | *INCLUDE, *OMIT | ||
SUBTREE | Directory subtree | *ALL, *DIR, *NONE, *OBJ, *STG | Optional |
SAVACT | Save active | *NO, *YES, *SYNC | Optional |
SAVACTOPT | Save active option | *NONE, *ALL, *ALWCKPWRT, *NWSSTG | Optional |
OUTPUT | Output | Path name, *NONE, *PRINT | Optional |
VOL | Volume identifier | Single values: *MOUNTED Other values (up to 75 repetitions): Character value |
Optional |
LABEL | Label | Character value, *GEN | Optional |
OPTFILE | Optical file | Path name, * | Optional |
SEQNBR | Sequence number | 1-16777215, *END | Optional |
EXPDATE | File expiration date | Date, *PERM | Optional |
ENDOPT | End of media option | *REWIND, *LEAVE, *UNLOAD | Optional |
USEOPTBLK | Use optimum block | *YES, *NO | Optional |
SAVACTMSGQ | Save active message queue | Path name, *NONE, *WRKSTN | Optional |
SYNCID | Synchronization ID | Name, *NONE | Optional |
INFTYPE | Type of output information | *ALL, *ERR, *SUMMARY | Optional |
SYSTEM | System | *ALL, *LCL, *RMT | Optional |
CHGPERIOD | Time period for last change | Element list | Optional |
Element 1: Start date | Date, *ALL, *LASTSAVE | ||
Element 2: Start time | Time, *ALL | ||
Element 3: End date | Date, *ALL | ||
Element 4: End time | Time, *ALL | ||
PRECHK | Object pre-check | *NO, *YES | Optional |
TGTRLS | Target release | *CURRENT, *PRV, V5R4M0, V6R1M0, V7R1M0 | Optional |
UPDHST | Update history | Single values: *NO, *YES Other values (up to 2 repetitions): *SYS, *PC |
Optional |
CLEAR | Clear | *NONE, *ALL, *AFTER, *REPLACE | Optional |
DTACPR | Data compression | *YES, *NO, *DEV, *LOW, *MEDIUM, *HIGH | Optional |
COMPACT | Data compaction | *DEV, *NO | Optional |
ASPDEV | ASP device | Name, *DFT, *ALLAVL, *, *SYSBAS, *CURASPGRP | Optional |
SCAN | Scan objects | Element list | Optional |
Element 1: Scan during save | *NO, *YES | ||
Element 2: Save failed objects | *NOSAVFAILED, *SAVFAILED | ||
PVTAUT | Private authorities | *NO, *YES | Optional |
Top |
Specifies the device to which the objects are to be saved.
For more information on specifying device path names, refer to "Specifying the device name" in the Backup and recovery topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
This is a required parameter.
Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.
For information about creating a media definition, see the Create Media Definition API in the APIs topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
For information about using a media definition, see the Recovering your system book, SC41-5304 and the Back up your server topic in the Backup and recovery topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Top |
Specifies the objects to be saved. You can specify an object name pattern for the path name to be used. When a path name is specified that could match many objects, you can specify a value for the Name pattern (PATTERN) parameter to subset the objects that are to be saved.
A maximum of 300 path names can be specified.
For more information on specifying path names, refer to "Object naming rules" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Additional information about object name patterns is in the Integrated file system topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.
Element 1: Name
Element 2: Include or omit
Specifies whether names that match the pattern should be included or omitted from the operation. Note that in determining whether a name matches a pattern, relative name patterns are always treated as relative to the current working directory.
Note: The SUBTREE parameter determines whether the subtrees are included or omitted.
Top |
Specifies one or more object name patterns to be used to subset the objects to be saved. The Objects (OBJ) parameter defines the set of candidate objects. A maximum of 300 values can be specified for this parameter.
Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.
Element 1: Pattern
Element 2: Include or omit
Specifies whether names that match the pattern should be included or omitted from the operation.
Note: The SUBTREE parameter determines whether the subtrees are included or omitted.
Top |
Specifies whether directory subtrees are included in the save operation.
Top |
Specifies whether an object can be updated while it is being saved.
Note: If your system is in a restricted state, this parameter is ignored and the save operation is performed as if SAVACT(*NO) was specified.
Top |
Specifies options to be used with the save while active parameter.
Note: This option should only be used by applications to save objects that are associated with the application and that have additional backup and recovery considerations. For more information, refer to the Backup and recovery topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Top |
Specifies whether a list of information about the saved objects is created. The information can be directed to a spooled file, a stream file, or a user space.
A stream file or user space is specified as a path name.
For more information on specifying path names, refer to "Object naming rules" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.
Top |
Specifies the volume identifiers of the volumes, or the cartridge identifiers of tapes in a tape media library device, on which the data is saved. The volumes must be placed in the device in the same order as specified for this parameter.
A maximum of 75 volume identifiers can be specified. After all specified volumes are filled, the save operation continues on whatever volumes are placed in the device.
Single values
Note: This value cannot be specified when using an optical media library device.
Other values (up to 75 repetitions)
Top |
Specifies the file identifier of the media to be used for the save operation.
Top |
Specifies the path name of the optical file that is used for the save operation, beginning with the root directory of the volume.
For more information on specifying path names, refer to "Object naming rules" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Top |
Specifies, when tape is used, the sequence number to use as the starting point for the save operation.
Top |
Specifies the expiration date of the file created by the save operation. If a date is specified, the file is protected and cannot be overwritten until the specified expiration date.
Notes:
Top |
Specifies the operation that is automatically done on the tape or optical volume after the save operation ends. If more than one volume is used, this parameter applies only to the last volume used; all other volumes are unloaded when the end of the volume is reached.
Note: This parameter is valid only if a tape or optical device name is specified for the DEV parameter. For optical devices, *UNLOAD is the only special value supported, *REWIND and *LEAVE will be ignored.
Top |
Specifies whether or not the optimum block size is used for the save operation.
Note: Specifying USEOPTBLK(*YES) may result in a tape that can be duplicated only to a device that supports the same block size.
Top |
Specifies the message queue that the save operation uses to notify the user that the checkpoint processing is complete.
For more information on specifying path names, refer to "Object naming rules" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.
Top |
Specifies the name of the synchronized checkpoint in which this save while active operation will participate. The synchronized checkpoint must already be started by the Start Save Synchronization (STRSAVSYNC) command.
Top |
Specifies the type of information that is directed to the spooled file, stream file, or user space.
Top |
Specifies whether to process objects that exist on the local system or remote systems.
Top |
Specifies a date/time range. Objects that were last changed within that range will be saved.
Element 1: Start date
Element 2: Start time
Note: Specifying an explicit time is valid only if the starting date is an explicit date.
Element 3: End date
Element 4: End time
Note: Specifying an explicit time is valid only if the ending date is an explicit date.
Top |
Specifies whether the save operation ends if any of the selected objects cannot be saved.
Top |
Specifies the release level of the operating system on which you intend to use the object being saved.
When specifying the target-release value, the format VxRxMx is used to specify the release, where Vx is the version, Rx is the release, and Mx is the modification level. For example, V5R3M0 is version 5, release 3, modification 0.
Valid values depend on the current version, release, and modification level of the operating system, and they change with each new release. You can press F4 while prompting this command parameter to see a list of valid target release values.
Top |
Specifies whether to update the save history on the objects saved with this save operation. The save history information is used when CHGPERIOD(*LASTSAVE) is specified on a later save operation.
Single values
Other values (up to 2 repetitions)
Top |
Specifies whether active data on the media is automatically cleared or replaced. Active data is any file on the media that has not expired. For saves to tape, clearing active data will make any files on the tape volume beyond the last file written by the save operation no longer accessible. For saves to optical, the files written by the save operation can be automatically replaced while other files on the volume remain active, or all active files can be automatically cleared. Clearing does not erase the data, it just makes the files no longer accessible.
Notes:
If tapes are used and a sequence number is specified for the SEQNBR parameter, the first tape is cleared beginning at that sequence number. All tapes following that first tape are completely cleared. To clear the entire first tape, SEQNBR(1) must be specified.
Note: The *AFTER value is not valid for save files.
Top |
Specifies whether data compression is used. If the save is running while other jobs on the system are active and software compression is used, the overall system performance may be affected.
Note: If *DEV is specified for both this parameter and the Data compaction (COMPACT) parameter, only device data compaction is performed if device data compaction is supported on the device. Otherwise, data compression is performed.
If *YES is specified for this parameter and *DEV is specified for the COMPACT parameter, both device data compaction and device data compression are performed if supported on the device.
Note: This value is not valid for tape.
Note: This value is not valid for tape.
Note: This value is not valid for tape.
Top |
Specifies whether device data compaction is performed.
Note: If *DEV is specified for both the Data compression (DTACPR) parameter and this parameter, only device data compaction is performed if device data compaction is supported on the device. Otherwise, data compression is performed if supported on the device.
If *YES is specified for the DTACPR parameter and *DEV is specified for this parameter, both device data compaction and device data compression are performed if supported on the device.
Top |
Specifies the auxiliary storage pool (ASP) device to be included in the save operation.
Top |
Specifies whether objects will be scanned while being saved when exit programs are registered with any of the integrated file system scan-related exit points and whether objects that previously failed a scan should be saved.
The integrated file system scan-related exit points are:
For details on these exit points, see the APIs topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Element 1: Scan during save
Element 2: Save failed objects
Top |
Specifies whether to save private authorities with the objects that are saved. Saving private authorities will increase the amount of time it takes to save the objects, but it can simplify the recovery of an object or a group of objects. It will not simplify the recovery of an entire system.
Note: You must have save system (*SAVSYS) or all object (*ALLOBJ) special authority to specify this value.
Top |
Example 1: Saving All Data Not in Libraries and Not Document Library Objects
SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ(('/*') ('/QSYS.LIB' *OMIT) ('/QDLS' *OMIT))
This command saves all objects that are not in libraries and are not document library objects.
Example 2: Saving Changes Since the Last Time the Objects Were Saved
SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ(('/*') ('/QSYS.LIB' *OMIT) ('/QDLS' *OMIT)) CHGPERIOD(*LASTSAVE)
This command saves all objects that are not in libraries, that are not document library objects, and that have changed since the last time they were saved with UPDHST(*YES) specified.
Example 3: Saving Data That Has Not Changed Since 1999
SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ(('/*') ('/QSYS.LIB' *OMIT) ('/QDLS' *OMIT)) CHGPERIOD((*ALL *ALL '12/31/99'))
This command saves all objects that are not in libraries, that are not document library objects, and that have not changed since December 31, 1999.
Example 4: Saving All Objects in the Current Directory
SAV DEV('/QSYS.LIB/TAP01.DEVD')
This command uses the default value '*' on the OBJ parameter to save all objects in the current directory and its subdirectories. This example is not valid if the current directory is the root directory or if the current directory is in the QDLS file system.
SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ('*') SUBTREE(*NONE)
This command saves all objects in the current directory but not in the subdirectories.
Example 5: Omitting Objects During a Save Operation
SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ(('*') ('**.BACKUP' *OMIT) ('**.TEMP' *OMIT))
This command saves all objects in the current directory except those with extensions of .BACKUP and .TEMP (the entire subtrees of directories with these extensions are omitted).
SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ(('/A') ('/A/B/C' *OMIT))
This command saves all objects in directory /A and its subdirectories, except those in directory /A/B/C.
Example 6: Saving a Library
SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ('/QSYS.LIB/A.LIB')
This command saves library A on the tape device named TAP01.
Example 7: Saving Two Libraries
SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ('/QSYS.LIB/A.LIB') SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ('/QSYS.LIB/B.LIB')
These two commands save two libraries. The first command saves library A and the second command saves library B.
Example 8: Saving All Files in a Library
SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ('/QSYS.LIB/MYLIB.LIB/*.FILE')
This command saves all files in the library MYLIB on the tape device named TAP01.
Example 9: Saving Two Objects in a Library
SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ('/QSYS.LIB/MYLIB.LIB/MYPGM.PGM') SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ('/QSYS.LIB/MYLIB.LIB/MYFILE.FILE')
These two commands save two objects in the same library. This first command saves the program MYPGM from library MYLIB. The second command saves the file MYFILE from library MYLIB.
Example 10: Saving a Stream File, a Database File, and a Document
SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ('/MyDir/MyFile') SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ('/QSYS.LIB/MYLIB.LIB/MYFILE.FILE') SAV DEV('/QSYS.LIB/TAP01.DEVD') OBJ('/QDLS/MYFLR/MYDOC') SUBTREE(*OBJ) UPDHST(*YES)
Three commands are used in this example to save three objects. The first command saves the stream file MyFile in the directory MyDir on the tape device named TAP01. The second command saves the database file MYFILE in the library named MYLIB on the tape device named TAP01. The third command saves the document MYDOC in a folder named MYFLR on the tape device named TAP01.
Example 11: Saving to a Save File
SAV DEV('/QSYS.LIB/MYLIB.LIB/MYSAVF.FILE') OBJ(MYDIR)
This command saves the directory MYDIR to a save file named MYSAVF.
Example 12: Using Symbolic Links for the Save Operation
SAV DEV('DevLink') OBJ(('DirLink') ('FileLink') ('DirLink/*')) SAVACT(*YES) SAVACTMSGQ('MsgqLink')
This command assumes that the current directory contains the following symbolic links:
This command saves the names associated with DirLink and FileLink, and the objects in SomeDirectory, to device TAP01. A message is sent when the save-while-active checkpoint is complete.
Symbolic links can be used to specify a device, a save-while-active message queue, and an output file. When symbolic links are specified to be saved, only the names of the associated objects are saved, not the content of the associated objects. A symbolic link to a directory can be used to save objects in the directory. Additional information about symbolic links is in the Integrated file system topic in the File systems and management category of the Information Center.
Example 13: Saving a Storage Space While it is Active
SAV DEV('/QSYS.LIB/MYLIB.LIB/MYSAVF.FILE') OBJ(('/QFPNWSSTG/MYDISK')) SAVACT(*YES) SAVACTOPT(*NWSSTG)
This command saves the objects associated with storage space '/QFPNWSSTG/MYDISK' even if the associated *NWSD is varied on.
Example 14: Saving Shares from a Windows, Linux or AIX Server
SAV DEV('/QSYS.LIB/MYLIB.LIB/MYSAVF.FILE') OBJ(('/QNTC/MYSERVER/MYSHARE'))
This command saves share MYSHARE and all of the objects the share contains from a server named '/QNTC/MYSERVER'. The example assumes that server MYSERVER was properly configured prior to running the SAV command. For more information on file level backup for Windows, Linux and AIX servers, see the Backup and recovery topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Top |
*ESCAPE Messages
Top |