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.

Script for Fixing Read Only Volumes

Discussion in 'Scripting' started by Kramer, Jul 7, 2008.

  1. Kramer

    Kramer New Member

    Joined:
    Mar 14, 2005
    Messages:
    38
    Likes Received:
    0
    Occupation:
    Server & Storage Specialist
    Location:
    Canberra, Australia
    Just thought I'd share the following script I wrote to fix read only volumes on my TSM Servers (this is a Windows command script). The only disadvantage is that I would like to run it through TSM as an Admin schedule - which I don't believe can be done with this kind of script?
    Code:
    @echo off
    REM
    REM	The following script reclaims readonly volumes
    REM
    
    
    set TSMID=adminid
    set TSMPASS=adminpassword
    set TSMSERVER=%COMPUTERNAME%
    
    set ROVOLS=C:\Temp\ReadOnlyVolumes.txt
    set LOG=C:\Temp\ReadOnlyVolumes.log
    
    cd C:\Progra~1\Tivoli\TSM\baclient
    
    C:\Progra~1\Tivoli\TSM\baclient\dsmadmc.exe -ID=%TSMID% -PASSWORD=%TSMPASS% -dataonly=yes -tcpserveraddress=%COMPUTERNAME% -outfile=%ROVOLS% "select volume_name, pct_utilized from volumes where access='READONLY' order by pct_utilized"
    for /f "tokens=1 " %%i in (%ROVOLS%) do (C:\Progra~1\Tivoli\TSM\baclient\dsmadmc.exe -ID=%TSMID% -PASSWORD=%TSMPASS% -tcpserveraddress=%COMPUTERNAME% "move data %%i wait=yes" >> %LOG%)
    
     
  2.  
  3. toxy13

    toxy13 Senior Member

    Joined:
    Sep 24, 2003
    Messages:
    739
    Likes Received:
    12
    Occupation:
    Administrator
    Location:
    Leipzig
    I think you can use a postschedule command to run you script!
     
  4. THE_WIPET

    THE_WIPET Senior Member

    Joined:
    May 10, 2006
    Messages:
    562
    Likes Received:
    16
    Location:
    Montreal
    a schedule task in you windows env could do it.
     
  5. Kramer

    Kramer New Member

    Joined:
    Mar 14, 2005
    Messages:
    38
    Likes Received:
    0
    Occupation:
    Server & Storage Specialist
    Location:
    Canberra, Australia
    I think the postschedule option would only work if I was to run this against my TSM server as a client node? In which case I could define a command schedule...

    Anyway for the moment I'm running it as Windows scheduled task - that way it can exit after 8 hours of processing (I currently have a HEAP of read only volumes as we are transitioning our library from LTO2 to LTO4).
     

Share This Page