Solved

IBM TSM : How to automate some administrative tasks

Posted on 2014-11-25
15
1,128 Views
Last Modified: 2014-11-26
Hello experts,
Everyday , I usually perform manually this three commands on tsm to recup volumes.

#BACKUP STG NTDISKPOOLF COPY POOL
#Expire inventory
#Reclaim STG NTDISKPOOLF

How can I do to automate these tasks every morning?
0
Comment
Question by:cismoney
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
15 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40465071
Use administrative schedules!

On the dsmadmc command line run (for example):

DEF SCHED BKUP_NDISKPOOLF T=A CMD="BACKUP STGP NTDISKPOOLF COPY_POOL" STARTTIME=06:00:00 PERIOD=1 PERUNITS=DAYS DAYOFWEEK=ANY DESC="Backup Storage Pool NDISKPOOLF to COPY_POOL"

Open in new window


DEF SCHED EXP_INVENTORY T=A CMD="EXPIRE INVENTORY QUIET=YES" STARTTIME=07:00:00 PERIOD=1 PERUNITS=DAYS DAYOFWEEK=ANY DESC="Start Inventory Expiration"

Open in new window


DEF SCHED RECL_NDISKPOOLF T=A CMD="RECLAIM STGP NDISKPOOLF" STARTTIME=08:00:00 PERIOD=1 PERUNITS=DAYS DAYOFWEEK=ANY DESC="Reclaim Storage Pool NDISKPOOLF"

Open in new window


The above commands define standard type schedules. There is also an enhanced schedule style which allows for specifying a month (Jan, Feb, Mar,...,Dec), a week of month (first, second, ..., last) and a day of month (1,2,3,...31)  instead of a period and a period unit. To define an enhanced-style schedule add "SCHEDSTYLE=ENHANCED" (or "SCHEDS=E") to the definition. Please run "HELP DEF SCHED" for more detail.

To avoid overlapping of the three processes you can add the commands (BACKUP ..., EXPIRE ..., RECLAIM ...)  to a TSM script (don't forget WAIT=YES) and define a single schedule with CMD="RUN scriptname".
If you're interested in creating TSM scripts please let me know.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40465565
To make it complete - here is how to create a script and integrate it into an admin schedule:

DEF SCR BKUP_EXP_RECL desc="Backup Stgpool, Expire inventory and Reclaim Stgpool"
UPD SCR BKUP_EXP_RECL "BACKUP STGP NTDISKPOOLF COPY_POOL WAIT=YES" line=10
UPD SCR BKUP_EXP_RECL "EXPIRE INVENTORY QUIET=YES WAIT=YES" line=20
UPD SCR BKUP_EXP_RECL "RECLAIM STGP NDISKPOOLF WAIT=YES" line=30

DEF SCHED BKUP_EXP_RECL T=A CMD="RUN BKUP_EXP_RECL" STARTTIME=06:00:00 PERIOD=1 PERUNITS=DAYS DAYOFWEEK=ANY DESC="Backup Storage Pool NDISKPOOLF, Expire Inventory, Reclaim Storage Pool NDISKPOOLF"

Open in new window

0
 

Author Comment

by:cismoney
ID: 40466601
thats great , thanx a lot .

Is it possible for me to add it to the maintenance script via command line?
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40466603
I don't know your maintenance script. What does it do? Is it a regular TSM script?

If so, you can display it on the dsmadmc command line with

Q SCR scriptname F=L

If you could post the outcome I could check what we can do.
0
 

Author Comment

by:cismoney
ID: 40466717
Hello Woolmilkporc,

I don't have access to the "maintenance script" via the GUI, its not working since the upgrade of tsm server to version 7.0 . I will try to download the fix.

This is why i am trying to edit the script via the command line

It seems that the name of the maintenance script is MAINTENANCE_PLAN_CUSTOM
maintenance_plan_custom

The output of the command Q SCR scriptname F=L doesn't show result.
output
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40466745
Q SCR MAINTENANCE_PLAN_CUSTOM F=L

of course ...
0
 

Author Comment

by:cismoney
ID: 40466780
ok this command works. I see that the script name is maintenance_plan_custom

maintenance
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40466806
It seems that this script doesn't do anything!
What is it supposed to do?

Is it scheduled?

Run this to check:

select SCHEDULE_NAME, STARTTIME, COMMAND from admin_schedules where upper(COMMAND) like '%MAINTENANCE%'

Open in new window

Any result?
0
 

Author Comment

by:cismoney
ID: 40466847
I don't really know what it's supposed to do because i don't have access to the maintenance tab on the GUI.


output of the command

maintenance script
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40466856
OK, this empty script runs at 17:28, probably daily. Very strange.

Adding our three commands to it will be quite simple. Shall we do it?
0
 

Author Comment

by:cismoney
ID: 40466874
yes we should definately add the commands ,
waiting for the commands
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 40466941
UPD SCR MAINTENANCE_PLAN_CUSTOM "/* Run Backup STGP, Expire Inventory and Reclaim STGP */" line=100
UPD SCR MAINTENANCE_PLAN_CUSTOM "SERIAL" line=110
UPD SCR MAINTENANCE_PLAN_CUSTOM "BACKUP STGP NTDISKPOOLF COPY_POOL WAIT=YES" line=120
UPD SCR MAINTENANCE_PLAN_CUSTOM "EXPIRE INVENTORY QUIET=YES WAIT=YES" line=130
UPD SCR MAINTENANCE_PLAN_CUSTOM "RECLAIM STGP NDISKPOOLF WAIT=YES" line=140

Open in new window

The above leaves the top of your old script as it is.
We add a comment to tell everybody what we're going to do at line 100.
Next we're instructing the script processor to run the following commands serially (line 110),
because we don't want the processes to overlap.
The last three lines (120-140) add our new commands, as already explained.

You can check the results of the above by running again

Q SCR MAINTENANCE_PLAN_CUSTOM F=L

Open in new window

The script can be run manually with "RUN MAINTENANCE_PLAN_CUSTOM", but you can also wait until 17:28 to let it run automatically (if the admin schedule has status "Active=Yes", of course).

If you want to check the active status run this and look for "YES" in the 3rd column:

select SCHEDULE_NAME, STARTTIME, ACTIVE, COMMAND from admin_schedules where upper(COMMAND) like '%MAINTENANCE%'

Open in new window

0
 

Author Comment

by:cismoney
ID: 40466973
wow it went great!!! Thanx  a lot boss

Just one more question, is it possible to change the date of the maintenance script planification?  I would like to plan this script every morning at 6am.

Is it possible to run it twice a day?

output
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40467031
Changing the start time of a schedule is easy, but running it twice a day is only possible
if the difference between the start times is exactly 12 hours
(otherwise the start time would "wander" through the day).
That's because only one "start time" can ce specified.

1) Change the start time to 6am:

UPD SCHED MAINTENANCE T=A STARTTIME=06:00:00 DAYOFWEEK=ANY

Open in new window

2) Change the start times to 6am and 6pm:

UPD SCHED MAINTENANCE T=A STARTTIME=06:00:00 PERIOD=12 PERUNITS=HOURS DAYOFWEEK=ANY

Open in new window

The latter is very uncommon in TSM, but it will work.

If the script must run twice a day with a time difference other than 12 hours we'll have to define another admin schedule to achieve this. That's not a big thing, though.
0
 

Author Closing Comment

by:cismoney
ID: 40467192
thanx a lot to woolmilkporc, he is a real tsm expert!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hyper-v migrate to new storage 1 64
Economy of Scale - IT Business 4 88
SCO 5.0.7 on HP Proliant DL380 G5 will not shutdown properly. 6 48
Linux kernel panic ext3-fs error 14 25
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Each year, investment in cloud platforms grows more than 20% (https://www.immun.io/hubfs/Immunio_2016/Content/Marketing/Cloud-Security-Report-2016.pdf?submissionGuid=a8d80a00-6fee-4b85-81db-a4e28f681762) as an increasing number of companies begin to…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question