I have multiple IFS objects present on an IFS path and I want to save those IFS objects inside the Save file present in my library later I want to restore them on the IFS. What command should I use to save and restore IFS objects to and from save files?
You can use the following commands to save and restore an IFS object to and from the save file.
Save IFS objects to save file (SAVF):
SAV DEV('/qsys.lib/libname.lib/savefilename.file')
OBJ(('/home/admin/files/test1.txt') ('/home/admin/files/test2.txt'))
Here, We use the Save object (
SAV
) command and specify the save file name with the fully qualified path in the DEV parameter, In theOBJ
parameter specifies the filestest1.txt
andtest2.txt
to be saved in the save file specified in theDEV
parameter.Restore IFS objects from the save file (SAVF) to the same IFS path from where it Saved:
RST DEV('/qsys.lib/libname.lib/savefilename.file')
OBJ(('/home/admin/files/test1.txt')
('/home/admin/files/test2.txt'))
CRTPRNDIR(*YES)
Here, We use the Restore object (
RST
) command and specify the save file name with the fully qualified path in theDEV
parameter, In theOBJ
parameter specifies the filestest1.txt
andtest2.txt
to be restored from the save file specified in theDEV
parameter. Also, theCRTPRNDIR
parameter is*YES
so that it would create a parent folder if not already exist.Restore IFS objects from the save file (SAVF) to the different IFS path from where it Saved:
RST DEV('/qsys.lib/libname.lib/savefilename.file')
OBJ(('/home/admin/files/test1.txt' *INCLUDE
'/home/admin/files/restore/test1.txt')
('/home/admin/files/test2.txt' *INCLUDE
'/home/admin/files/newfolder/test2.txt'))
CRTPRNDIR(*YES)
Here, We use the Restore object (
RST
) command and specify the save file name with the fully qualified path in theDEV
parameter, In theOBJ
parameter specifies the filestest1.txt
and after*INCLUDE
specified the new object name/path andtest2.txt
and after*INCLUDE
specified the new object name/path to be restored from the save file specified in the DEV parameter. Also, theCRTPRNDIR
parameter is*YES
so that it would create a parent folder if not already exist.Note: The new object/path will be created by the command
RST
itself. So, no need for new folders to exist before running theRST
command.