Scripting Help Needed for Backing up NAS File Systems

clangford

Newcomer
Joined
Jun 7, 2011
Messages
4
Reaction score
0
Points
0
Hi, I'm wondering if anyone could help me out here with a script I need to write.

I need the script to start four concurrent NAS backup jobs of filesystems and then as one finishes - start another one up, making sure there is only ever 4 jobs running at one time (a limitation of Celerra data movers). I have about 14 filesystems I need to get backed up. If anyone has any ideas to get me started on how to script this I would appreciate it a lot.

Thanks!
 
Define the commands in a TSM script by putting the commands in a list and use WAIT=YES along with the SERIAL and PARALLEL options. What the example shows below is 4 run using the PARALLEL option and the SERIAL tells TSM to wait til the previous 4 commands complete before running the next line which is PARALLEL which will allow the next 4 to kick off then the serial tells TSM to wait for those 4 to complete to move to the next line and so on...

EXAMPLE TSM SCRIPT

PARALLEL
BACKUP NODE NAS1 /vol/vol0 mgmt=NASclass toc=YES wait=YES mode=FULL
BACKUP NODE NAS1 /vol/vol1 mgmt=NASclass toc=YES wait=YES mode=FULL
BACKUP NODE NAS1 /vol/vol2/data mgmt=NASclass toc=YES wait=YES mode=FULL
BACKUP NODE NAS1 /vol/vol3/data2 mgmt=NASclass toc=YES wait=YES mode=FULL
SERIAL
PARALLEL
BACKUP NODE NAS1 /vol/vol4/DB mgmt=NASclass toc=YES wait=YES mode=FULL
BACKUP NODE NAS1 /vol/vol5/file01 mgmt=NASclass toc=YES wait=YES mode=FULL
BACKUP NODE NAS1 /vol/vol6/file02 mgmt=NASclass toc=YES wait=YES mode=FULL
BACKUP NODE NAS1 /vol/vol7/file03 mgmt=NASclass toc=YES wait=YES mode=FULL
SERIAL
PARALLEL ....
 
Thanks, I understand this will work. My aim though is to always have 4 backups running at any given time to optimize my backup window. The Files systems vary in sizes so for example - vol0 could finish hours before vol2 so for those hours I'm only having 3 file systems backing up. I'm sure there must be a way to do this - I'm just not sure of the syntax that's valid in the admin scripting that I could use.

I'm thinking I could use a counter - a variable that keeps track of how many jobs are running. When one job finishes it decreases the counter - indicating another job can start, which, in turn, increases the counter.

I'm just new to TSM in general so I'm not sure what kind of scripting I can do with it.
 
You'd need to run a select that counts the # of NAS backup processes and if less than 4 it kicks off the next line in a list until the count reachs 4 then pauses and checks every X minutes until the list is completed.

I figure the following would count the processes....now to just write the rest.

J=`dsmadmc -id=admin -pa=admin -servern=TSMSERV1 -dataonly=yes select count(process) from processes where process='NAS Backup'
 
On further testing that select works best if you make it a macro and call it from the dsmadmc command.

macro

select count(process) from processes where process='NAS Backup'

Portion of shell script

J=`dsmadmc -id=admin -pa=admin -servern=TSMSERV1 -dataonly=yes macro /home/user1/macros/process_chk.mac `
 
That is a great idea! Although I do have a bit of a wrench. I have 3 celerra data movers so I can have 4 jobs running on EACH running so doing a general count of NAS backup processes won't quite work. My plan was to have 3 scripts. One for backups on each data mover. I assume I could just add to the SQL select .."where node=<node name specific to Datamover> and that would solve the issue?
 
Back
Top