Legal Hold Backup

Brenton

Newcomer
Joined
Jun 5, 2012
Messages
4
Reaction score
0
Points
0
Hello everyone every month I have to run the command "GENERATE BACKUPSET RWEXCH1AH21 LGL052012 Devclass=ltodev toc=preferred wait=no retention=nolimit" to run our monthly legal hold backup of our exchange servers. Im trying to automate this process by using a script but I need some help. I would need to change LGL052012 to the previous month and year everymonth before I run the backup so TSM knows to backup the previous month. Also how can I get these tapes that it dos the backup to to eject automatically when done. Thanks everyone for your help
 
What environment are you on - I would be suggesting a script outside of TSM but the script depends on whether you are in Windows or Unix/Linux.
 
This works by default in Windows 2008 and later. Powershell is needed.

@echo off

ren Run this in c:\Program Files\Tivoli\TSM\balient where
ren dsmadmc.exe is located

PowerShell $date = Get-Date; $date=$date.AddMonths(-1); $date.ToString('MMyyyy') > lastMth.dat

for /F %%i in (lastMth.dat) do (
dsmadmc -id=admin -pa=adminpass "GENERATE BACKUPSET RWEXCH1AH21 LGL%%i Devclass=ltodev toc=preferred wait=no retention=nolimit"
)

Save as a cmd fle.

Schedule it to run at the first of each month.
 
Thanks so much this looks like it is going to work perfect. Is there any way I can get TSM to eject these tapes once the backup is done?
 
Thanks so much this looks like it is going to work perfect. Is there any way I can get TSM to eject these tapes once the backup is done?

When something like this is executed from outside TSM, the challenge is to know when a process such as this is done and go on to the next step.

Well, it won't be straightforward and easy to do. What you can try is look for the AN code from the actlog that signals the 'generate backupset' is done and base the tape ejection from there. I don't know the AN code for this!
 
Last edited:
Hey moon-buddy what would the script be if I need it to be for the current month thanks
 
Replace: PowerShell $date = Get-Date; $date=$date.AddMonths(-1); $date.ToString('MMyyyy') > lastMth.dat

with: PowerShell $date = Get-Date; $date.ToString('MMyyyy') > lastMth.dat
 
Back
Top