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


Backing up selected files by date

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

The following examples pertain to the z/OS® shell only, and demonstrate how to back up selected files that may have been modified within a specified number of days. To do this you create a "find" command that returns the list of files that meet the specified criteria, and then use the output from this command as the list of files input to pax.

Example: To back up all files in the directory /u/source that have been modified in the last week, issue:
pax -wzvf backup.pax.Z    $( find /u/source -type f -mtime -8 ) 
Example: To back up all files in the directory /u/usrtools/ that have not been accessed in the last 100 days, issue:
pax -wzvf backup.pax.Z    $( find /u/usrtools -type f -atime +100 )
Note: The tar equivalent for the pax portion of the previous commands is:
tar -czUvf backup.pax.Z

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014