z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Backing up a complete directory into an MVS data set

z/OS UNIX System Services User's Guide
SA23-2279-00

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:
  1. 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'" ./ 
  2. 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'" ./
  3. 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.
  4. 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.
  5. 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.
  6. The -z option is used to turn on compression, and is not required.
  7. The -v option is used to display the names of files as they are being stored, and is not required.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014