Informing the IBM Community

Backup the backup of your backup

0
(0)

It may sound like we’re getting into some sort of recursion error, but I like to think of it as the poor mans VTL, Virtual Tape Library, and something you can try at home (I assume most of us are working at home right now.)

A little bit of background, most of my customers are still on LTO cartridges of some description, but they backup to savefile first which is then offloaded onto the tape. This has the advantage that if the tape offload fails, we still have a copy of the backup to work from.

With circumstances being what they are, we’ve tried to get customers to load tapes before offices go into full lockdown. This means you can set it to rewind and keep doing the nightly backup as normal. But what if both fail, or a customer wasn’t able to put the tape in?

Well luckily, we have plenty of intel servers at various degrees of usefulness/activity with some spare disk space. So, I figure lets at least get a copy of my backup off of this particular rack. Even if all that means is it’s on the opposite side of the server room that’s still better than a poke in the eye?

So that I keep control of the process I’d rather the IBMi did a put rather than something else doing a get. The simple answer to that is if the intel server I’m being offered runs FTP services, but what about if it doesn’t? Then we’ll play with the IFS and QNTC.

For those who haven’t used it, QNTC is part of the function to allow the IBMi communicate with smb/cifs network shares (like say, windows shares.) You’ll need to make sure you have access to the relevant server plus, if you’re offloading your backup there, then you want some sort of security/permissions in place. For the sake of the example I’ve got an IBMi profile that also exists in active directory and the passwords are the same on both sides, but you might want to look into your own systems to find what works well.

Bear in mind as well any differences in password rules (insert grumble about my v5r4 customer running at pwdlvl 0.) Also using 5.4 as an example the version of SMB will be a little archaic and so convincing your intel admin to enable an older version could be a fun conversation. Luckily in this example the customer also has a 7.2 partition so I’m passing through that to be a little more modern.

The next question is how you choose to actually get the files from point A to B, given my backup is already in savefile format I figure lets just move those. Some of you may be familiar with the method for transferring a savefile in the IFS to a library using FTP? If not IBM do a nice support article on the subject, and naturally the method works in reverse as well. /QNTC/<servername>/<foldername> is still part of the IFS after all, so you can FTP to your local server and mput your savefiles to the intel server.

A very basic version of what the FTP script might look like:

<username> <password>          
namefmt 1                 
bin                       
lcd /qsys.lib/backuplib.lib
cd /qntc/server/IBMibackup
mput *.savf               
quit                      

You could have multiple versions of the script, for example, if you want to backup to/from a different location depending on day of the week. Alternatively, you could have a template txt source member and stamp some variables into it before running.

Another hurdle you should consider, what will your program do if the folder isn’t there? Say for example the server is down. The default answer is your savefiles are all going to get dumped into qgpl which can cause its own problems, I didn’t have to fight against a box at 100% disk usage…honest….

The solution I’m using at the moment is the CHKIN command, although the server at the other end won’t understand the command (CPFA0AD) the fact you’re getting that error means it’s at least there. If you got CPFA0A9 instead (object not found) then you know the folder has gone walkabouts and can abort processing / throw errors to the crowd.

MONMSG     MSGID(CPFA0AD)                  

MONMSG     MSGID(CPFA0A9) EXEC(DO)         
SNDUSRMSG  MSG(‘Backup offload failed – +  
             server/folder not found’) +
             MSGTYPE(*INFO) TOUSR(*SYSOPR) 
GOTO       CMDLBL(ENDPGM)                  

ENDDO

Obviously in an ideal world you would tidy this up a lot, or even better get a proper VTL instead of trying to build your own out of milk bottle tops and string. But in these interesting times we are cursed to live in, you make do with what you’ve got I suppose?                                       



How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *