11-27-2013 09:21 PM
Solved! Go to Solution.
11-28-2013 03:16 AM
To get the date you need to use the variables - pick them from this string which will put the date, time and seconds in for you, all seperated by underscores
You should be able to work out what is what from this so use the parts you want:
%date:~-4,4%%date:~-7,2%%date:~0,2%_%time:~0,2%%time:~3,2%%time:~6,2%
So the above gives 20131128_103247 (the last part is 10.32 and 47 seconds)
As you need it in the format mm/dd/yyyy you will actually need to use:
%date:~7,2%/%date:~0,2%/%date:~4,4% in your command when viweing but extra to pipe out - giving you:
nbpemreq -predict -date %date:~-7,2%/%date:~0,2%/%date:~-4,4% >c:\predict_%date:~-4,4%%date:~-7,2%%date:~0,2%.txt
This outputs to a predict_20131128.txt file (well it does today anyway!)
You still need blat to then send the file to email but can just do that on a second line and then put both in a .bat file
So final should be - if you put this in a predict.bat - this cleans up yesterdays file first
del c:\predict*.txt
nbpemreq -predict -date %date:~-7,2%/%date:~0,2%/%date:~-4,4% >c:\predict_%date:~-4,4%%date:~-7,2%%date:~0,2%.txt
Blat c:\predict*.txt -s "nbpemreq predict" -t foo@bar.com
Hope this helps
#edit#
if you dont have paths setup you need to add the path to nbpem req:
"c:\program files\veritas\netbackup\bin\admincmd\nbpemreq" -predict ........
11-27-2013 10:08 PM
Put the command in a text file and rename the file as jobs_predict.bat .
Then schedule a task using a task scheduler "http://windows.microsoft.com/en-sg/windows7/schedule-a-task{C}"
Rememer U will need to have the windows mailing cient ( like blat ) inorder to get the emails
11-28-2013 03:16 AM
To get the date you need to use the variables - pick them from this string which will put the date, time and seconds in for you, all seperated by underscores
You should be able to work out what is what from this so use the parts you want:
%date:~-4,4%%date:~-7,2%%date:~0,2%_%time:~0,2%%time:~3,2%%time:~6,2%
So the above gives 20131128_103247 (the last part is 10.32 and 47 seconds)
As you need it in the format mm/dd/yyyy you will actually need to use:
%date:~7,2%/%date:~0,2%/%date:~4,4% in your command when viweing but extra to pipe out - giving you:
nbpemreq -predict -date %date:~-7,2%/%date:~0,2%/%date:~-4,4% >c:\predict_%date:~-4,4%%date:~-7,2%%date:~0,2%.txt
This outputs to a predict_20131128.txt file (well it does today anyway!)
You still need blat to then send the file to email but can just do that on a second line and then put both in a .bat file
So final should be - if you put this in a predict.bat - this cleans up yesterdays file first
del c:\predict*.txt
nbpemreq -predict -date %date:~-7,2%/%date:~0,2%/%date:~-4,4% >c:\predict_%date:~-4,4%%date:~-7,2%%date:~0,2%.txt
Blat c:\predict*.txt -s "nbpemreq predict" -t foo@bar.com
Hope this helps
#edit#
if you dont have paths setup you need to add the path to nbpem req:
"c:\program files\veritas\netbackup\bin\admincmd\nbpemreq" -predict ........
11-28-2013 04:11 AM
Thanks Mark for the script description. :)
12-28-2013 07:20 AM
This was helpful and pointed me in the right direction. Thank you.