To back up the complete directory
/u/project, including
the subdirectories and their contents, into a compressed archive stored
in the MVS™ data set
'PROJECT.ARCHIVE',
enter the following commands:
cd /u/project
pax -wzvf /tmp/project.pax.Z ./
tso "oget '/tmp/project.pax.Z' 'PROJECT.ARCHIVE' binary"
Note: - The pax command can write directly to
the MVS data set; you can skip
the OGET command by specifying the MVS data
set on the pax command:
pax -wzvf "//'PROJECT.ARCHIVE'" ./
- The equivalent tar commands are:
tar -cUzvf /tmp/project.pax.Z ./
To
write directly to MVS (OS/390® Release 8 or later):
tar -cUzvf "//'PROJECT.ARCHIVE'" ./
- You change to the current directory first in order to simplify
the pax/tar command, and so that the files
are stored in the archive using a path name that is relative to the
current directory. This simplifies the task of restoring the archive
later to a different directory. The "./" is used
rather than an asterisk to collect any component files that begin
with "." in the current directory.
- The archive is written to a directory that is not in the source
path that is being archived, in order to prevent pax/tar from
trying to store the archive within itself. Doing so can cause pax/tar to
loop infinitely during creation, and can result in corrupted files
during restore.
- Naming archives with a suffix of "pax.Z" (or
"tar.Z") is not required by pax/tar,
but is done as a convention to identify them as pax or tar archive
files. The ".Z" is used to identify a compressed
file.
- The -z option is used to turn on compression, and is not
required.
- The -v option is used to display the names of files as
they are being stored, and is not required.