Automated AS400 Backup Procedure

Posted on 2012-04-10
Last Modified: 2012-05-08
Presently, the process to backup our AS400 requires several steps. User must log on to pc console. User must start operations console if it is not already running.  User must open session. User must initialize tape. Then user runs OPTION 21 (save entire system) from the SAVE MENU. I would like to automate this. Has anyone else done this? If so, do you have a procedure I could use as a starting point?
Job should be scheduled
Job should start when system is IPL'd or restarted
Job should initialize tape
Job should save files
Jobe should send msg to specified operator

Question by:rodneygray
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2

Expert Comment

ID: 37831060
Is this just an every day backup or do you really need the system backup?

If you are preforming a system backup, keep doing the 21.  You don't want to have to explain to the boss that you lost the system because you wanted to save a few minutes.

If it is for daily saves, you can create a CL that will end QINTER and QBATCH to remove locks and the do a SAVLIB of *ALLUSR.  you will end up omitting some IBM libs.

Answer the questions above and I may have a suggestion.

LVL 16

Expert Comment

by:theo kouwenhoven
ID: 37831515
Hi  rodneygray,

Did you ever looked to the standard iSeries backup tool? and all options you can use there (e.g. Init before save etc)

Gust type GO BACKUP on a command line.

LVL 27

Expert Comment

ID: 37835615
You can setup and run "full system saves" without having someone available, but it's not trivial to do.

The major reason comes down to the fact that there is rarely a need to do a "full system save" except under special circumstances. Circumstances might be just before doing an operating system upgrade or to prepare for migration to a new system. It can also be useful just before applying a significant cume PTF package.

The difficulty of "full system save" is that it means saving elements of the system that are actively being used by the save operation while the save is executing (e.g., the operating system itself). It's not trivial trying save stuff that is actively in use. Further, if you save the operating system once, there's not much point in saving it again the next day.

So, the parts of "full system save" the require the special handling are commonly saved once. (They might be saved twice, just to have a backup copy stashed somewhere else.)

The rest of the stuff on your system can be saved daily much easier. That's the stuff that you'd be changing with your applications -- records in files, streamfiles, etc. All of that can be scheduled without much problem.

Note that the GO BACKUP menu, and its SETUPBCKUP sub-menu, doesn't even make the QSYS library available for selection.

A "full system save" takes some work if you really want it done automatically on a schedule. If you can justify saving the parts (i.e., library QSYS and some IBM product libraries), we can explore options. Just be aware that it's not going to happen soon.

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Author Comment

ID: 37835674
I am open to performing a full system save on a monthly basis and just saving user libraries and files on a daily basis.

Expert Comment

ID: 37835963
You should take Tom's advise first.  See if that works for you.  If not, you could write your own CL to handle any special problems you may have.

LVL 16

Expert Comment

by:theo kouwenhoven
ID: 37836054
Full, monthly, weekley, daily, or once, it all can be done by the standard iSeries backup tool :-)
LVL 27

Assisted Solution

tliotta earned 250 total points
ID: 37839324
The GO BACKUP menu can guide you through setting up a schedule for user libraries/objects. Review the menu options, starting with option 10, Set up backup. Then, on the SETUPBCKUP menu, review options that define what to back up and when.

After review, see how many questions remain and ask them here.

@Murph -- Unless you're referring to the BRMS product, I don't know of any way to do a "full" backup through the BACKUP menu. You can indeed request *ALL libraries, but it only covers all "user" libraries (libraries with user related data objects) up to i 7.1 at least. It doesn't include QSYS, QDEVTOOLS and many others. If you know how to get others, it will be a useful addition to this question.

LVL 35

Accepted Solution

Gary Patterson earned 250 total points
ID: 37874312
Unattended backups from "GO BACKUP" menu

We may just have a difference of opinion about the term "unattended".  

You can start an unattended backup from the console using option 20 to set backup options including a start time, and then hitting option 21.  The console will lock up until the time you defined in option 20.  Then the following sequence is executed:

STRSBS SBSD(controlling-subsystem)

Bear in mind you will have to initiate option 21 manually each day, but the backup is done later, unattended.

You need to follow the instructions for your OS release and version, and there are a number of planning considerations, including how secure your console is, since anyone could SysReq-2 out of the backup and gain access to the system using whatever profile is signed in to do the backup.

Look at the checklist starting on P7 of the V5R4 Backup and Recovery Guide for and example:

Now, on to the original question:

Scheduled Restricted State Backups Possible Starting in V5R3

You didn't mention your OS version, but starting in V5R3, you can put the system into a restricted state in a batch job, something that you couldn't do in prior releases.  You can then run restricted state backups from a scheduled batch job.  Same planning considerations apply, so read the Backup and Recovery Guide first, but this will give you a framework and discuss the possible pitfalls of running console-less for a while:

Pre V5R3?

If you are on an older release, it is still possible, but more work and clunkier.  Several years ago I developed a Windows-based program for a client that, as I recall worked something like this:

On a scheduled basis, our Windows program initiated a remote console connection using Ops Console, signed on, and kicked off the monthly full system save.  We had already automated all of the non-restricted state backups, and this was the last step in full backup automation.  It has been a few years, so details escape me, but it didn't take long to set up.

- Gary Patterson
LVL 27

Expert Comment

ID: 37883941
Gary's reference to the IBM document is a good starting place. But pay very close attention to this 'Note' in that document:
Modifications to the CLP, such as ending applications and TCP prior to ending the subsystems and monitoring for messages, may be advantageous for a customer environment.
Where the note uses the word 'advantageous', you might substitute 'critical'. Maybe.

Without knowing how your system operates, it's mostly a guess whether it will work well or not. Fortunately, if you're already doing daily or near-daily "full-system saves", then your environment can probably tolerate it; but others who read this question in the future may need to consider what other processes might happen at night, e.g., ODBC connections.


Expert Comment

ID: 37884254
I write custom CL for each of my customers.  They are all different.

If you elect to do the same, do yourself a favor and make sure you can get a signon screen if you end QINTER.  I do that by adding a WSE to QPGMR and have it up.  Stuff happens and you may lock yourself out.


Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Original post  on Monitis Blog. Web performance monitoring is broken into two camps: passive and active. Passive monitoring is defined as looking at real-world historical performance by monitoring actual log-ins, site hits, clicks, requests for…
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question