Start Date/Time Email Script

CharlesTSM

ADSM.ORG Member
Joined
Jun 10, 2015
Messages
16
Reaction score
0
Points
0
Hey,

We have a daily script that gives us an Email output for the days Backups. However the problem we have is that backups run overnight so we end up getting all of last nights and some of the previous nights which means we have to double check them all in case they are false failures from the night before. It is becoming a little tiresome so I want to modify the script however not having much joy!

So what we have already completed by the guys who installed this system many moons ago:

Start-Process -filepath "C:\Program Files\Tivoli\TSM\baclient\dsmadmc.exe" `
-WorkingDirectory "C:\Program Files\Tivoli\TSM\baclient" `
-ArgumentList "-id=xxxx-pass=xxxx-dataonly=y -comma -outfile=c:\tsmresults\results5.txt `"`"SELECT nodes.node_name, events.status,events.result,

events.scheduled_start, events.completed FROM nodes, events WHERE nodes.node_name=events.node_name and SCHEDULED_START>=date(CURRENT_DATE - 1 day) order by STATUS,

nodes.node_name, SCHEDULED_START; `" "`
-NoNewWindow -Wait

I tried to change the SCHEDULED_START>=date(CURRENT_DATE - 1 day) to SCHEDULED_START>=time(CURRENT_TIME- 12 Hours) however this did not work, tried to google on this and look through IBM's website but no joy.

Any chance someone knows off the top of their head how to reduce the time this script looks back for?

Thanks,

Charles
 
You're very close with that change - just change CURRENT_TIME to CURRENT_TIMESTAMP and it should work.
 
Hi Ches,

Thanks for the reply, sadly even changing to the TIMESTAMP I get SCHEDULED_START; failed. on the Emails...

So this is what I have now:

Start-Process -filepath "C:\Program Files\Tivoli\TSM\baclient\dsmadmc.exe" `
-WorkingDirectory "C:\Program Files\Tivoli\TSM\baclient" `
-ArgumentList "-id=xxxx-pass=xxxxx-dataonly=y -comma -outfile=c:\tsmresults\results5.txt `"`"SELECT nodes.node_name, events.status,events.result, events.scheduled_start, events.completed FROM nodes, events WHERE nodes.node_name=events.node_name and SCHEDULED_START>=time(CURRENT_TIMESTAMP - 12 hours)order by STATUS, nodes.node_name, SCHEDULED_START; `" "`
-NoNewWindow -Wait
 
Aha sorted it I didn't need the time so this works:

Start-Process -filepath "C:\Program Files\Tivoli\TSM\baclient\dsmadmc.exe" `
-WorkingDirectory "C:\Program Files\Tivoli\TSM\baclient" `
-ArgumentList "-id=xxxx-pass=xxxxx-dataonly=y -comma -outfile=c:\tsmresults\results5.txt `"`"SELECT nodes.node_name, events.status,events.result, events.scheduled_start, events.completed FROM nodes, events WHERE nodes.node_name=events.node_name and SCHEDULED_START >= (CURRENT_TIMESTAMP - 12 hours)order by STATUS, nodes.node_name, SCHEDULED_START; `" "`
-NoNewWindow -Wait
 
Oh yeah, sorry - didn't notice the 'time' part in there. Glad its all working now.
 
q ev * * begind=today-1 begint=18:00 endd=today endt=08:00
or same command w/ exceptionsonly=yes to see failures.
 
Back
Top