Automated AS400 Backup Procedure

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

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

MurpheyApplication ConsultantCommented:
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.

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.

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

rodneygrayAuthor Commented:
I am open to performing a full system save on a monthly basis and just saving user libraries and files on a daily basis.
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.

MurpheyApplication ConsultantCommented:
Full, monthly, weekley, daily, or once, it all can be done by the standard iSeries backup tool :-)
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.

Gary PattersonVP Technology / Senior Consultant Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.

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.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IBM System i

From novice to tech pro — start learning today.