1. Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING) Click the link to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This message will disappear after you have made at least 12 posts. Thank you for your cooperation.

Scripting Help Needed for Backing up NAS File Systems

Discussion in 'Scripting' started by clangford, Jun 29, 2011.

  1. clangford

    clangford New Member

    Joined:
    Jun 7, 2011
    Messages:
    4
    Likes Received:
    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!
     
  2.  
  3. chad_small

    chad_small Moderator

    Joined:
    Dec 17, 2002
    Messages:
    2,207
    Likes Received:
    44
    Occupation:
    AIX/SAN/TSM
    Location:
    Gilbert, AZ
    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 ....
     
  4. clangford

    clangford New Member

    Joined:
    Jun 7, 2011
    Messages:
    4
    Likes Received:
    0
    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.
     
  5. chad_small

    chad_small Moderator

    Joined:
    Dec 17, 2002
    Messages:
    2,207
    Likes Received:
    44
    Occupation:
    AIX/SAN/TSM
    Location:
    Gilbert, AZ
    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'
     
  6. chad_small

    chad_small Moderator

    Joined:
    Dec 17, 2002
    Messages:
    2,207
    Likes Received:
    44
    Occupation:
    AIX/SAN/TSM
    Location:
    Gilbert, AZ
    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 `
     
  7. clangford

    clangford New Member

    Joined:
    Jun 7, 2011
    Messages:
    4
    Likes Received:
    0
    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?
     

Share This Page