Skip to main content

Back up UNIX Directory to z/OS Dataset

This example demonstrates using UCMD Manager on z/OS to back up a UNIX directory, using the UNIX tar command with the compress options, to a z/OS data set.

The backup script is allocated to the ddname MYSCRIPT. The script writes the tgz file to its standard out which is transmitted by the UCMD Server to the UCMD Manager which writes it to the UNVOUT ddname. The data set hlq**.BKUP.TGZ** allocated to the UNVOUT ddname will contain the tgz backup file.

The data set hlq**.BKUP.TGZ** must be a variable record format data set. Any valid record length or valid block size will work.

//jobname  JOB CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//*
// JCLLIB ORDER=SBI.UNV.SUNVSAMP
//*
//STEP1 EXEC UCMDPRC,
// STDOUT='DISP=SHR,DSN=hlq.BKUP.TGZ'
//*
//MYSCRIPT DD *
cd /export/home/username/fnd || exit 8
tar -cvzf - . || exit 8
//SYSIN DD *
-host hostname
-userid username
-pwd password
-script MYSCRIPT
-stdout -mode binary
/*

SYSIN Options

The SYSIN options used in this example are:

Option

Description

-host

Host name or IP address of the remote system on which to execute the script.

-userid

Remote user ID with which to execute the command.

-pwd

Password for the user ID.

-script

ddname from which to read the script file. The script file is sent to the remote system by the UCMD Manager for execution.

-stdout

Starts the stdout options. All options read afterwards are applied to the stdout file. The first option not recognized as a standard file option terminates the stdout option list.

-mode

Transfer mode for the stdout file: binary. Since a backup file is a tar, compressed format contains binary data, it should not be translated as text data.

Components

Universal Command Manager for z/OS