Home > AS/400 Tips > iSeries administrator tips > Working in shades of SAV
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES ADMINISTRATOR TIPS

Working in shades of SAV


Joe Hertvik
07.08.2002
Rating: -3.24- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


It's valuable to understand some of the different backup options available under IBM's Save Object (SAV) command, which is used to save any object in OS/400's Integrated File System (IFS). Using these options, you can perform a full save of the Integrated File System or a partial save of IFS files based on patterns in your file naming conventions. Partial saves come in handy for backing up information stored under a single IFS directory, such as the root directory of a Web server, a Domino directory, or an application data directory. Using partial IFS saves, you can segment your backup strategy to save different IFS directories to different tape drives or to move an application (such as a Domino server) to a save file or tape for migration to another system.

Given these benefits, let's look at some of the different options you can set on the SAV command and how they can help you implement both full and partial IFS backups.

1. To save the entire IFS -- excluding your native OS/400 libraries and document library objects (DLOs) -- to a tape drive, most people use a variant on the following SAV command:

SAV DEV('qsys.lib/tap01.devd') OBJ(('/*') ('/QSYS.LIB' *OMIT) ('/QDLS' *OMIT))

SAV uses the Objects (OBJ) parameter list to specify the IFS file system or folders to save. This particular statement saves the entire IFS starting at its root directory (as specified by the '/*' literal) to tape. It omits your native OS/400 DB2/UDB information (contained in the '/QSYS.LIB' file system) as well as your DLO system ('/QDLS'), which are also stored and accessed from the IFS root. This is essentially the same command IBM uses to save the IFS when you perform a full system backup off the green screen by using option 21 on the GO SAVE menu. When saving the entire IFS like this, it's important to omit the /QSYS.LIB and /QDLS paths, because they are generally saved through other OS/400 commands, and SAV's purpose is to save information from your IFS. It's also important to note that the device you're saving to -- TAP01 in this case -- must also entered under its IFS name (qsys.lib/tap01.devd) for the command to run properly.

2. If you want to save a certain folder (ex, /srch400) under the IFS root -- while ignoring all your other IFS folders -- you could execute the following command:

SAV DEV('qsys.lib/tap01.devd') OBJ(('/srch400*' *INCLUDE))

This segments your IFS backup by saving just those files and directories that match the '/srch400' pattern. If you wanted to segment the backup even more by excluding a sub-directory under '/srch400' called '/joe', you could omit that directory by modifying the statement to the following format:

SAV DEV('qsys.lib/tap01.devd') OBJ(('/srch400*') ('/srch400/joe*' *OMIT))

Like the previous example, this statement backs up everything in the '/srch400' IFS directory and its subdirectory but -- whenever the SAV statement encounters a file or directory the matches the '/srch400/joe' pattern -- it omits it from the backup.

If you want to modify the command to also save all directories under the '/techtrgt' directory on the IFS root, you can recode the SAV command to the following:

SAV DEV('qsys.lib/tap01.devd') OBJ(('/srch400*' *INCLUDE) ('/techtrgt' *INCLUDE) ('/srch400/joe*' *OMIT))

The end result of playing with the OBJ parameter list is that you can selectively back up one or more directories in the IFS by using patterns, while excluding other sub-directories that also match sub-patterns in your list. As a personal habit, I code all my *INCLUDE statements higher in the OBJ list and then enter the *OMIT statements lower. While I'm not sure this makes a difference in processing, it does make for an easier-to-read parameter list.

3. If you want to include or exclude all subdirectories for the patterns under your OBJ list, use the Directory subtree (SUBTREE) parameter. This parameter has four options: *ALL, which saves the first-level directories, all sub-directories and associated objects under the patterns listed in the OBJ list (*ALL is the default); *DIR, which save all the objects in the first level directories specified in the OBJ list, as well as the directory structure (but not the objects) of the sub-directories under each first level directory; *NONE, which only backs up objects and directories matching the pattern while excluding both the subdirectory entries and their corresponding objects; and *OBJ, which only saves objects that exactly match the object name pattern. So taking my earlier command that backs up any directory matching the '/srch400' pattern, I can explicitly tell SAV to back up the first-level directories and their sub-directories by changing it to the following:

SAV DEV('qsys.lib/tap01.devd') OBJ(('/srch400*' *INCLUDE)) TREE(*ALL)

If I wanted to want to back up only the '/srch400' directory while ignoring its subdirectories, I could change the statement to this:

SAV DEV('qsys.lib/tap01.devd') OBJ(('/srch400*' *INCLUDE)) TREE(*NONE)

And SAV will ignore '/srch400's subdirectory tree as it performs its backup.

If I wanted to back up the first-level '/srch400' directory and also back up the subdirectory structure under '/srch400' (but not the objects in each subdirectory), I would change my SUBTREE parameter to *DIR, as follows:

SAV DEV('qsys.lib/tap01.devd') OBJ(('/srch400*' *INCLUDE)) TREE(*DIR)

The SAV command can be fairly flexible and allow you to segment your IFS backup strategy in ways you may not have thought possible. And there is even another set of parameters that allow you to select files to be saved based on their last change or backup date (see the Time period for last change, CHGPERIOD, parameter on the command).

So be sure to take a second look at the OS/400 SAV command. It doesn't take much to master and it might help you backup that tricky set of files you've been trying to save.

-------------------------
About the author: Joe Hertvik is an IT professional and freelance writer who has been working with OS/400 since the days of the System/38 in the mid-1980s. Joe can be reached at jhertvik@midrangeserver.com.

========================
MORE INFORMATION
========================

  • Spooled files go poof
    "Damien" was having a problem with print jobs not printing from his printer even though it went to PND, then WTR, and then a SAV status. From the iSeries, the job looked like it printed, but there was no output at the printer. He turned to the Search400 OS/400 Discussion Forum for advice. Read what other iSeries users suggested.
  • RST of information saved using SAV command
    This member wonders if a RST of information saved using SAV command has not been done when migrating from one iSeries to another. He turned to Search400 site expert John Brandt to see what implications might this have for future use of the IFS.
  • Managing the iSeries Discussion Forum: Post your questions, and get answers from other iSeries systems managers and administrators as well as search400 experts.
  • Search400's Best Web Links on Systems Management


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Systems Management
Can you trust all those trigger programs?
Are your backups complete?
Controlling remote command processing
Watch your profiles
Avoid locking issues
Send message to users at a remote site
Security journal receiver management
Top 10 backup commands
Tracking critical file access in real time
Create an iSeries Access image and update it with the latest Service Pack

iSeries administrator tips
Translating Linux for IBM i admins: Using GUI to make it easy
Translating Linux for IBM i admins: Working with jobs and networking
OpenOffice: What to know before making the transition from Microsoft Office
OpenOffice: An enterprise open source solution
Database performance comparisons on IBM i
Translating Linux for IBM i admins: User profile commands
Modern System i reports using Client Access
Tips for installing Lotus Domino server on a System i partition
The iSeries Blog has a new home on IT Knowledge Exchange
Virtualization for IBM i: Backups

Performance
Will overloaded discs impact iSeries performance?
Extend storage capacity on an IBM i without negatively effecting system performance
Database drivers on the i: MySQL vs. IBM Toolbox
Performance tuning for IBM i: The basics and beyond
IBM releases new Power products for the midrange
Top System i admin tips for 2006
Catholic Charities keeps track of homeless with iSeries
i5 error messages: What you need to know
IBM races for clock speed
System shutting down after cleanup

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts