Home
TFH
OS/400 Edition
Volume 11, Number 30 -- August 5, 2002

Admin Alert: Copying IFS Directories Between Two iSeries, Part 1


by Joe Hertvik

If you're performing OS/400 system administration, you'll inevitably have to transfer OS/400 Integrated File System information from one AS/400 or iSeries server to another, using a save file, FTP, and possibly e-mail. To help you understand how to use these techniques as a group for moving IFS data, I'm presenting a primer this week and next that explains all the steps in saving, e-mailing, FTPing, and restoring IFS directories between two iSeries boxes.


For our example, let's assume you want to duplicate all the information contained in the IFS /tfh directory from one iSeries to another. There are many valid reasons for doing this. You may be migrating WebSphere configurations from one iSeries to another. You could be distributing software upgrades to customers. Or you could just be moving private files to a different box. Whatever the reason, moving an IFS directory involves a number of easy steps, including saving the information from your source IFS directory to a save file, FTPing and (possibly) e-mailing the file to another location, and restoring the IFS directory from the save file to your target AS/400. In this issue, I'll concentrate on saving the IFS data for transport. Next week, I'll explain how to use FTP and e-mail to send that file to another iSeries box, as well explain how to use OS/400's Restore (RST) command to restore it to that machine.

The first step is to save your IFS data in an OS/400 save file, which allows you to easily move information between OS/400 boxes or across the Internet by using FTP and e-mail. To save the IFS /tfh directory for easy transport, you first have to create an empty save file for capturing the data. To create a save file, called TFHSAVE, in an OS/400 library, called ADMIN, you could use the following green-screen Create Save File (CRTSAVF) command:

CRTSAVF FILE(ADMIN/TFHSAVE)

OS/400 requires that a save file be empty before it can be used in a save operation, and a newly created save file covers that criteria. However, if save file ADMIN/TFHSAVE already existed on your system and you wanted to clear it for an upcoming save operation, you could use the following Clear Save File (CLRSAVF) command:

CLRSAVF FILE(ADMIN/TFHSAVE)

To save the /tfh directory to our save file, use the OS/400 Save Object (SAV) command. But there's a "gotcha" in the way that you tell SAV that your media device is a save file instead of a tape drive. Even though SAV is a native OS/400 command, it uses IFS syntax--including the QSYS.LIB designation for objects that reside in the native OS/400 file system--for the path names in both the Device (DEV) and the Object (OBJ) parameters of the command. The DEV parameter specifies the backup media that the objects will be saved to, while the OBJ parameter specifies the path name of the actual IFS objects that will be included in, or omitted from, the save operation.

For native OS/400 objects, such as tape drives and save files, this means that you have to specify QSYS.LIB as part of the backup media location; you can't just tell SAV to back up to ADMIN/TFHSAVE, because that won't work. You have to use IFS notation to point SAV to the proper location of your save file. So the SAV command for our example would be coded like this:

SAV DEV('QSYS.LIB/ADMIN.LIB/TFHSAVE.FILE') OBJ(('/tfh*' *INCLUDE))

IFS notation specifies that you refer to DB2 UDB objects in a multi-part format separated by slashes (/), where each part of the description describes another part of the path to the object's location, as well as the object type of the designated device. The first segment of this DEV parameter tells us that the device is in the QSYS.LIB file system, which is contained off the root (/) of the IFS. The second segment, ADMIN.LIB, tells SAV to look for the backup media in the ADMIN library (.LIB). And TFHSAVE.FILE tells SAV to back up the directory to a file (.FILE) called TFHSAVE (which must be a save file).

The OBJECT parameter in our SAV statement is fairly simple. Since we're saving the IFS /tfh directory and tfh is stored directly off the IFS root (/), we simply tell SAV that this directory should be included in our backup, by including an entry in the OBJ parameter list that pairs the tfh* directory specification with the *INCLUDE value. By coding an asterisk (*) at the end of my directory name (/tfh*), I'm also telling SAV to treat this entry as a wildcard and to back up any IFS object whose path name starts with the /tfh string. It's also important to note that the OBJ parameter is a list that can contain multiple *INCLUDE entries for saving several different directories at the same time. Conversely, you can code *OMIT entries in the OBJ parameter list in order to exclude specific subdirectories or objects that would normally be saved through a corresponding *INCLUDE entry.

After we execute our SAV command, all the objects in the /tfh directory would be saved in the ADMIN/TFHSAVE file on our iSeries box. The next step is to get that save file off our OS/400 machine and over to the iSeries box that we want to restore it to. And we'll cover that procedure in next week's Admin Alert.


Sponsored By
ELITE DOCUMENT SOLUTIONS

Elite Document Solutions has taken the electronic form to the next level. Think beyond laser forms – think intelligent documents! Automatically sort, burst and "intelligently route" business-critical documents via laser printer, e-mail, fax, archive and web presentation. One print file in – multiple destinations out!

Elite Document Solutions is dedicated to helping companies improve business-critical document processing, while maximizing the return on investment.

http://www.elitedocuments.com/Downloads/body_downloads.html


THIS ISSUE
SPONSORED BY:

Aldon Computer Group
BCD Int'l
Elite Document Solutions
Centerfield Technology
RJS Software Systems
FAST400


BACK ISSUES

TABLE OF CONTENTS
IBM Clarifies One Green Streak Deal, Adds Another

IBM Buys PricewaterhouseCoopers IT Consulting Biz

Admin Alert: Copying IFS Directories Between Two iSeries, Part 1

Tech Insight: OS/400 Remote Journaling Issues

But Wait There's More . . .

As I See It: Loving Your Manager

Editor
Timothy Prickett Morgan

Managing Editor
Shannon Pastore

Contributing Editors:
Dan Burger
Joe Hertvik
Kevin Vandever
Shannon O'Donnell
Victor Rozek
Hesh Wiener
Alex Woodie

Contact the Editors
Do you have a gripe, inside dope or an opinion?
Email the editors:
editors@itjungle.com



Last Updated: 8/5/02
Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.