Storage Software
1755776 Members
3350 Online
108838 Solutions
New Discussion юеВ

SSSU Query

 
SOLVED
Go to solution
SAKET_5
Honored Contributor

SSSU Query

Hi,

New to SSSU and perhaps a very simple query - I would like to schedule a regular backup of our EVA configs - so I use a batch file first that calls this SSSU script that basically runs the "CAPTURE CONFIGURATION filename.txt" command. I noticed that if you run the same script twice, the second time - it just doesn't complete - my reasoning being it sees the same filename and aborts the script.

Now, this is the simple bit but my head has stopped working now ofcourse...how do I append the date and time at the end of the filename - so every time I run the script it works!

For a batch file, I could just simply put these four lines to get the date and time appended in the filename - but SSSU seems to follow a different syntax perhaps:
for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt=%dt%%tm%

I would like to say in my SSSU script:
CAPTURE CONFIGURATION EVA_CONFIG_%DTT%_%TM%.TXT

Any help would be appreciated.

Thanks,
Saket.

 

P.S. This thread has been moved from Storage Area Networks (SAN) (Enterprise) to HP Storage System Scripting Utility (SSSU). -HP Forum Moderator

5 REPLIES 5
Uwe Zessin
Honored Contributor
Solution

Re: SSSU Query

I would do CAPTURE CONFIGURATION to a fixed filename and then do a RENAME from the command interpreter:

rename EVA_CONFIG.txt EVA_CONFIG-%dtt%.txt
.
Uwe Zessin
Honored Contributor

Re: SSSU Query

I've played a bit with your code as I like your idea, but prefer a slightly different filename format.

It looks like the date fields are separated by '/' on your version of Windows while they are separated by '.' on a German system. Here is a different solution I came up with:

-----
set d1=%DATE:~6,10%-%DATE:~3,2%-%DATE:~0,2%
set t1=%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2%
set dt=%d1%_%t1%

copy nul b.txt
rename b.txt b_%dt%.txt
-----

Watch out as the result from the %DATE% might look different on your system:
E:\TST>echo %DATE%
25.03.2005

E:\TST>
.
Uwe Zessin
Honored Contributor

Re: SSSU Query

Outch! I should not work late ;-) It breaks early in the mornig when the hour is a single-digit number, because there is a space character for the first digit. Here is a fix:

set d1=%DATE:~6,10%-%DATE:~3,2%-%DATE:~0,2%
set t1="%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2%"
set dt=%d1%_%t1:~1,8%
if "%t1:~1,1%"==" " set dt=%d1%_0%t1:~2,7%
.
SAKET_5
Honored Contributor

Re: SSSU Query

Hi Uwe,

Thanks for those valuable tips. My EVAs are now being backed up nightly, i.e. configuration of EVAs one siteA get their configuration backed up directly on siteB and vice versa. Also embedded "blat" in my script to send a notficiation email once the script completes a successful run.

Now onto implementing a script that goes around and connects to all my SAN Fabric switches and runs "configupload" to capture the switch config on a regular basis. I have downloaded a few tools/scripts from Brocade site and plan to look at them shortly. Any thoughts that you may want to share here?

Next one is to get a script that connects to the HSG80s to run a few commands to capture their stuff (I will miss the "CAPTURE_CONFIG" command, i m sure), e.g. "supportshow", "show this", "show other", "show storagesets", "show raidsets", "show mirrorsets", etc.

Thanks Uwe,

Regards,
Saket.

Uwe Zessin
Honored Contributor

Re: SSSU Query

Hello Saket,
our customer's environments are rather stable, so I haven't done any automatisation here.

For capturing HSG configuration I use this set of commands:
---
show this_controller full
show other_controller full
show disks full
show mirrorsets full
show stripesets full
show raidsets full
show concatsets full
show units full
show id
show remote_copy_sets full
show associations full
show connections full
show sparesets
show failedsets
show managers
---
For older RA/ESA boxes I think a
> show emu

might be useful, too, as there have been situations where it was necessary to change the sensor trip points.
.