LindaC
asked on
Batch File not executing Do - Loop - Maybe a vbscript will do ? Windows 2003 Server
I have the following script but the DO - LOOP is only executing once and do not execut the "hot_CMDB_backup_end.bat".
I f the loop will execute like a loop then it will run perfectly. The thing is that I don't know how to do it in batch file or maybe in vbscript?
Attached is the script.
I f the loop will execute like a loop then it will run perfectly. The thing is that I don't know how to do it in batch file or maybe in vbscript?
Attached is the script.
set newDate=%date:~4,2%-%date:~7,2%-%date:~10%
set arg=CMDB
start C:\oracle\Dba\scripts\CMDB\hot_backup_scripts\hot_CMDB_backup.bat
C:
cd C:\Program Files\Veritas\NetBackup\bin
start bpbackup -p Windows-Servers-dbs -s %arg% -L C:\oracle\Dba\logs\CMDB\hot_backup_logs\%arg%_28_Hotback.%newDate%.log -f C:\oracle\Dba\scripts\CMDB\hot_backup_scripts\%arg%list.txt
set var_stop=1
Do
sleep 10
tasklist.exe /fi "IMAGENAME eq bpbackup.exe">C:\oracle\Dba\logs\CMDB\hot_backup_logs\borrame.txt
tasklist.exe /fi "IMAGENAME eq bpbkar32.exe”>>C:\oracle\Dba\logs\CMDB\hot_backup_logs\borrame.txt
tasklist.exe /fi "IMAGENAME eq bpcd.exe”>>C:\oracle\Dba\logs\CMDB\hot_backup_logs\borrame.txt
findstr /i /s "bpbackup.exe bpbkar32.exe bpcd.exe" C:\oracle\Dba\logs\CMDB\hot_backup_logs\borrame.txt
echo error level is %errorlevel% >>C:\oracle\Dba\logs\CMDB\hot_backup_logs\logfile.txt
if %errorlevel% equ 0 (echo Todavía está corriendo el envío a Veritas > C:\oracle\Dba\logs\CMDB\hot_backup_logs\Verificacion.log )
if %errorlevel% equ 1 (echo Terminó el envio a Veritas >> C:\oracle\Dba\logs\CMDB\hot_backup_logs\Verificacion.log) & start C:\oracle\Dba\scripts\CMDB\hot_backup_scripts\hot_CMDB_backup_end.bat & Exit Do
Loop
exit;
ASKER
Checking.
I see you are setting the variable 'var_stop' to '1' but you're not actually using it in your code.
Going back to your loop-thing, you could also use a conditional loop like this:
:Loop
.
.
If "%var_stop%"=="0" Goto Loop
Going back to your loop-thing, you could also use a conditional loop like this:
:Loop
.
.
If "%var_stop%"=="0" Goto Loop
Sorry, let me clarify that last one.
You could use any of these:
:Loop
.
.
If not "%var_stop%"=="1" Goto Loop
or
:Loop
.
.
If not "%var_stop%"=="0" Goto Loop
whatever way around you choose to it, it's fine....
These also work too:
:Loop
.
.
If "%var_stop%"=="0" Goto Loop
.
and
:Loop
.
.
If "%var_stop%"=="0" Goto Loop
but are the inverse of above.
You could use any of these:
:Loop
.
.
If not "%var_stop%"=="1" Goto Loop
or
:Loop
.
.
If not "%var_stop%"=="0" Goto Loop
whatever way around you choose to it, it's fine....
These also work too:
:Loop
.
.
If "%var_stop%"=="0" Goto Loop
.
and
:Loop
.
.
If "%var_stop%"=="0" Goto Loop
but are the inverse of above.
Because of the space, your CD command needs double-quotes. See below...
cd C:\Program Files\Veritas\NetBackup\bi n
should be:
cd "C:\Program Files\Veritas\NetBackup\bi n"
(notice the space in 'Program Files'?)
cd C:\Program Files\Veritas\NetBackup\bi
should be:
cd "C:\Program Files\Veritas\NetBackup\bi
(notice the space in 'Program Files'?)
Where are you getting %args% from?
ASKER
The :Loop Goto :Loop is working but I think it is not recognizing the sleep.
I have modified it to sleep 600 but it is too fast. Is the sleep command ok?
The arg is in the second line of the code in my posting.
I have modified it to sleep 600 but it is too fast. Is the sleep command ok?
The arg is in the second line of the code in my posting.
You can change this:
if %errorlevel% equ 1 (echo Terminó el envio a Veritas >> C:\oracle\Dba\logs\CMDB\hot_backup_logs\Verificacion.log) & start C:\oracle\Dba\scripts\CMDB\hot_backup_scripts\hot_CMDB_backup_end.bat & Exit Do
to:
If %errorlevel% EQU 1 (
Echo Terminó el envio a Veritas >>C:\oracle\Dba\logs\CMDB\hot_backup_logs\Verificacion.log
Start C:\oracle\Dba\scripts\CMDB\hot_backup_scripts\hot_CMDB_backup_end.bat
Goto :EOF
)
ASKER
Checking this new way.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what's you operating system? Sleep is not compatible in all versions of windows...
if you're using an external program named SLEEP.COM or SLEEP.EXE then it should work with your O/S. Also, if SLEEP is part of your O/S DOS command then it shoulg work.
ASKER
About the sleep I found in this link what to do http://malektips.com/dos0017.html
Now I 'am swaping the lines, but I noticed an "else".
Do I have to include else, do I have to include end if?
Now I 'am swaping the lines, but I noticed an "else".
Do I have to include else, do I have to include end if?
In XP, we pause a batch file by using the PING command whose output is simply redirected to the NUL device like this:
Pause for 1 second
ping -n 1 -w 1000 127.0.0.1 >nul
Pause for 5 seconds
ping -n 1 -w 5000 127.0.0.1 >nul
Pause for 10 seconds
ping -n 1 -w 10000 127.0.0.1 >nul
Etc....
Pause for 1 second
ping -n 1 -w 1000 127.0.0.1 >nul
Pause for 5 seconds
ping -n 1 -w 5000 127.0.0.1 >nul
Pause for 10 seconds
ping -n 1 -w 10000 127.0.0.1 >nul
Etc....
structure of IF is...
IF condition (
- do this if true
) ELSE (
- do this if false
)
The last closing bracket is the equivalent to 'End-If'
IF condition (
- do this if true
) ELSE (
- do this if false
)
The last closing bracket is the equivalent to 'End-If'
You've got most ofyour answers already by the looks of it, but I would normally pause using:
ping -n X localhost >nul
will normally wait for X-1 secs. So use
ping -n 11 localhost >nul
for 10 secs.
You can use the -w parameter to wait for a reply BUT that only works against a local address that doesnt respond so I find the above the easiest.
Steve
ping -n X localhost >nul
will normally wait for X-1 secs. So use
ping -n 11 localhost >nul
for 10 secs.
You can use the -w parameter to wait for a reply BUT that only works against a local address that doesnt respond so I find the above the easiest.
Steve
sorry, didn't spot the 'set arg=CMDB' near the top...
As arg is static why not just hard-code CMDB straight into you code like this:
As arg is static why not just hard-code CMDB straight into you code like this:
start bpbackup -p Windows-Servers-dbs -s CMDB -L "C:\oracle\Dba\logs\CMDB\hot_backup_logs\CMDB_28_Hotback.%newDate%.log"
Good point dragon-it
To clarify, this should pause fo 10 seconds...
ping -n 10 127.0.0.1 >nul
To clarify, this should pause fo 10 seconds...
ping -n 10 127.0.0.1 >nul
ASKER
Now it worked and thank you!
It also was not working because two double quotes where different in the tasklist "lines" , see the double quotes in line 15 and 16 and compare it to line 14. The double quotes in lines 15 and 16 where interpreted as some "strange" special character and it resulted in "ERROR: Invalid query".
I fix it and with your help it worked succesfully now:
See the result:
19:36:02 INF - END C:\Program Files\Veritas\NetBackup\bi n\bpend_no tify.Windo ws-Servers -dbs.CMDB. BAT
19:36:03 INF - Backup by oracle on client primadb using policy Windows-Servers-dbs, sched CMDB:the requested operation was successfully completed
Backup ended 19:36:02
And tablespaces where put in end backup mode in this time:
TO_CHAR(SYSDATE,'MM-DD-YY- HH24:MI:SS ')
-------------------------- ---------- ---------- ---------- ---------- ---------
03-27-10-19:37:15
Tablespace altered.
It also was not working because two double quotes where different in the tasklist "lines" , see the double quotes in line 15 and 16 and compare it to line 14. The double quotes in lines 15 and 16 where interpreted as some "strange" special character and it resulted in "ERROR: Invalid query".
I fix it and with your help it worked succesfully now:
See the result:
19:36:02 INF - END C:\Program Files\Veritas\NetBackup\bi
19:36:03 INF - Backup by oracle on client primadb using policy Windows-Servers-dbs, sched CMDB:the requested operation was successfully completed
Backup ended 19:36:02
And tablespaces where put in end backup mode in this time:
TO_CHAR(SYSDATE,'MM-DD-YY-
--------------------------
03-27-10-19:37:15
Tablespace altered.
ASKER
Excellent!
ASKER
I 'am just posting the resulting HOT_BACKUP.bat (which is the father script that calls veritas):
set newDate=%date:~4,2%-%date: ~7,2%-%dat e:~10%
set arg=CMDB
start C:\oracle\Dba\scripts\CMDB \hot_backu p_scripts\ hot_CMDB_b ackup.bat
C:
cd "C:\Program Files\Veritas\NetBackup\bi n"
start bpbackup -p Windows-Servers-dbs -s %arg% -L C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\%arg%_ 28_Hotback .%newDate% .log -f C:\oracle\Dba\scripts\CMDB \hot_backu p_scripts\ %arg%list. txt
set var_stop=1
:Loop
call C:\oracle\Dba\scripts\CMDB \hot_backu p_scripts\ WAIT.bat 15
tasklist.exe /fi "IMAGENAME eq bpbackup.exe">C:\oracle\Db a\logs\CMD B\hot_back up_logs\bo rrame.txt
tasklist.exe /fi "IMAGENAME eq bpbkar32.exe">>C:\oracle\D ba\logs\CM DB\hot_bac kup_logs\b orrame.txt
tasklist.exe /fi "IMAGENAME eq bpcd.exe">>C:\oracle\Dba\l ogs\CMDB\h ot_backup_ logs\borra me.txt
findstr /i /s "bpbackup.exe bpbkar32.exe bpcd.exe" C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt
if %errorlevel% equ 0 (
echo Todavía está corriendo el envío a Veritas > C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\Verifi cacion.log
echo error level is %errorlevel% >>C:\oracle\Dba\logs\CMDB\ hot_backup _logs\logf ile.txt
Goto :Loop
) else (
echo Terminó el envio a Veritas >> C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\Verifi cacion.log
echo error level is %errorlevel% >>C:\oracle\Dba\logs\CMDB\ hot_backup _logs\logf ile.txt
start C:\oracle\Dba\scripts\CMDB \hot_backu p_scripts\ hot_CMDB_b ackup_end. bat
Goto :Terminar
)
:Terminar
exit;
set newDate=%date:~4,2%-%date:
set arg=CMDB
start C:\oracle\Dba\scripts\CMDB
C:
cd "C:\Program Files\Veritas\NetBackup\bi
start bpbackup -p Windows-Servers-dbs -s %arg% -L C:\oracle\Dba\logs\CMDB\ho
set var_stop=1
:Loop
call C:\oracle\Dba\scripts\CMDB
tasklist.exe /fi "IMAGENAME eq bpbackup.exe">C:\oracle\Db
tasklist.exe /fi "IMAGENAME eq bpbkar32.exe">>C:\oracle\D
tasklist.exe /fi "IMAGENAME eq bpcd.exe">>C:\oracle\Dba\l
findstr /i /s "bpbackup.exe bpbkar32.exe bpcd.exe" C:\oracle\Dba\logs\CMDB\ho
if %errorlevel% equ 0 (
echo Todavía está corriendo el envío a Veritas > C:\oracle\Dba\logs\CMDB\ho
echo error level is %errorlevel% >>C:\oracle\Dba\logs\CMDB\
Goto :Loop
) else (
echo Terminó el envio a Veritas >> C:\oracle\Dba\logs\CMDB\ho
echo error level is %errorlevel% >>C:\oracle\Dba\logs\CMDB\
start C:\oracle\Dba\scripts\CMDB
Goto :Terminar
)
:Terminar
exit;
Instead of using long paths throughout the batch file I would have preferred something along these lines. (I haven't test this code but it choud give you a general idea).
:: ========================== ========== ========== ========== =======
:: Your batch file title
::
:: ========================== ========== ========== ========== =======
@echo off
set WorkingDirectory=C:\Progra m Files\Veritas\NetBackup\bi n
set Logs=C:\oracle\Dba\logs\CM DB\hot_bac kup_logs
set Scripts=C:\oracle\Dba\scri pts\CMDB\h ot_backup_ scripts
set LogFile=%Logs%\logfile.txt
set VerifyFile=%Logs%\Verifica cion.log
set BorrameFile=%Logs%\borrame .txt
start "%Scripts%\hot_CMDB_backup .bat"
cd /d "%WorkingDirectory%"
set Server=CMDB
set Today=%Date:~4,2%-%Date:~7 ,2%-%Date: ~10%
set Policy=Windows-Servers-dbs
set LogFile=%Logs%\CMDB_28_Hot back.%Toda y%.log
set FileList=%Scripts%\CMDBlis t.txt
start bpbackup -p %Policy% -s %Server% -L "%LogFile%" -f "%FileList%"
:Loop
call "%Scripts%\WAIT.bat 15"
( tasklist /fi "IMAGENAME eq bpbackup.exe"
tasklist /fi "IMAGENAME eq bpbkar32.exe"
tasklist /fi "IMAGENAME eq bpcd.exe"
)>"%BarromeFile%"
findstr /i /s "bpbackup.exe bpbkar32.exe bpcd.exe" "%BorrameFile%"
if %errorlevel% equ 0 (
echo Todavía está corriendo el envío a Veritas>"%VerifyFile%"
echo error level is %errorlevel%>>"%LogFile%"
goto :Loop
)
echo Terminó el envio a Veritas>>"%VerifyFile%"
echo error level is %errorlevel%>>"%LogFile%"
start "%Scripts%\hot_CMDB_backup _end.bat"
exit
:: ==========================
:: Your batch file title
::
:: ==========================
@echo off
set WorkingDirectory=C:\Progra
set Logs=C:\oracle\Dba\logs\CM
set Scripts=C:\oracle\Dba\scri
set LogFile=%Logs%\logfile.txt
set VerifyFile=%Logs%\Verifica
set BorrameFile=%Logs%\borrame
start "%Scripts%\hot_CMDB_backup
cd /d "%WorkingDirectory%"
set Server=CMDB
set Today=%Date:~4,2%-%Date:~7
set Policy=Windows-Servers-dbs
set LogFile=%Logs%\CMDB_28_Hot
set FileList=%Scripts%\CMDBlis
start bpbackup -p %Policy% -s %Server% -L "%LogFile%" -f "%FileList%"
:Loop
call "%Scripts%\WAIT.bat 15"
( tasklist /fi "IMAGENAME eq bpbackup.exe"
tasklist /fi "IMAGENAME eq bpbkar32.exe"
tasklist /fi "IMAGENAME eq bpcd.exe"
)>"%BarromeFile%"
findstr /i /s "bpbackup.exe bpbkar32.exe bpcd.exe" "%BorrameFile%"
if %errorlevel% equ 0 (
echo Todavía está corriendo el envío a Veritas>"%VerifyFile%"
echo error level is %errorlevel%>>"%LogFile%"
goto :Loop
)
echo Terminó el envio a Veritas>>"%VerifyFile%"
echo error level is %errorlevel%>>"%LogFile%"
start "%Scripts%\hot_CMDB_backup
exit
Oh, by the way, I'm not sure if these are what you intend them to be:
(From my code above) This will create a new file
)>"%BarromeFile%"
whereas, this will append to an existing file:
)>>"%BarromeFile%"
As the other 3 ECHO lines have '>>', I'm not sure if you meant this one to be just:
echo Todavía está corriendo el envío a Veritas>"%VerifyFile%"
Finally, if your existing code works well then you need not implement my suggested code. It's merely to demonstrate a different structure and compactness.
I now consider the question closed. Thank you for the points etc...
(From my code above) This will create a new file
)>"%BarromeFile%"
whereas, this will append to an existing file:
)>>"%BarromeFile%"
As the other 3 ECHO lines have '>>', I'm not sure if you meant this one to be just:
echo Todavía está corriendo el envío a Veritas>"%VerifyFile%"
Finally, if your existing code works well then you need not implement my suggested code. It's merely to demonstrate a different structure and compactness.
I now consider the question closed. Thank you for the points etc...
ASKER
I will definitely test *more later*.
The single redirection is ok, as it will be written on again and again until the %errorlevel% =1
Bye, I have to go now, but later I will test.
The single redirection is ok, as it will be written on again and again until the %errorlevel% =1
Bye, I have to go now, but later I will test.
ASKER
This part is not working from your last Modified - New script:
set WorkingDirectory=C:\Progra m Files\Veritas\NetBackup\bi n
set Logs=C:\oracle\Dba\logs\CM DB\hot_bac kup_logs
set Scripts=C:\oracle\Dba\scri pts\CMDB\h ot_backup_ scripts
Set History=C:\oracle\Dba\logs \Historial
set LogFile=%Logs%\logfile.txt
set VerifyFile=%Logs%\Verifica cion.log
set BorrameFile=%Logs%\borrame .txt
set HistoryFile=%History%\CMDB _hotbackup _HISTORIAL .log
set Server=CMDB
set Today=%Date:~4,2%-%Date:~7 ,2%-%Date: ~10%
set Policy=Windows-Servers-dbs
set LogFile=%Logs%\CMDB_Hotbac k.%Today%. log
set FileList=%Scripts%\CMDBlis t.txt
:Queued
( tasklist /fi "IMAGENAME eq oracle.exe"
tasklist /fi "IMAGENAME eq oracle.exe"
tasklist /fi "IMAGENAME eq oracle.exe"
)>"%BarromeFile%"
:Loop
C:\oracle\Dba\scripts\CMDB \hot_backu p_scripts> (
tasklist /fi "IMAGENAME eq oracle.exe"
tasklist /fi "IMAGENAME eq oracle.exe"
tasklist /fi "IMAGENAME eq oracle.exe"
) 1>""
The system cannot find the path specified.
set WorkingDirectory=C:\Progra
set Logs=C:\oracle\Dba\logs\CM
set Scripts=C:\oracle\Dba\scri
Set History=C:\oracle\Dba\logs
set LogFile=%Logs%\logfile.txt
set VerifyFile=%Logs%\Verifica
set BorrameFile=%Logs%\borrame
set HistoryFile=%History%\CMDB
set Server=CMDB
set Today=%Date:~4,2%-%Date:~7
set Policy=Windows-Servers-dbs
set LogFile=%Logs%\CMDB_Hotbac
set FileList=%Scripts%\CMDBlis
:Queued
( tasklist /fi "IMAGENAME eq oracle.exe"
tasklist /fi "IMAGENAME eq oracle.exe"
tasklist /fi "IMAGENAME eq oracle.exe"
)>"%BarromeFile%"
:Loop
C:\oracle\Dba\scripts\CMDB
tasklist /fi "IMAGENAME eq oracle.exe"
tasklist /fi "IMAGENAME eq oracle.exe"
tasklist /fi "IMAGENAME eq oracle.exe"
) 1>""
The system cannot find the path specified.
ASKER
A typo - instead of Barrome is Borrame.
Sorry, you are right. it was a typo.
it was only meant to be a reworking of your own code. I mainly did a lot of cutting and pasting.
Did you get it working in the end?
it was only meant to be a reworking of your own code. I mainly did a lot of cutting and pasting.
Did you get it working in the end?
ASKER
It is working now, but I have to get rid of the double quotes when calling the start "%Scripts%\hot_CMDB_backup .bat".
Also the writing of the borrame.txt is giving me sometimes the following messages that it is not giving in the original. I have attached both the first one with the additinal loop named "Queued", which is waiting for some process of veritas to showed up, because in some cases Veritas Queued the jobs if they are many at the same time and it has to "wait".
The other modification is the loop "Terminar", which "unified the Veritas log with the alter tablespace log.
Original is named HOT_BACKUP.bat and yours is Test2.bat.
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
6612 Console 0 6,104 K
The process cannot access the file because it is being used by another process.
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpbk ar32.exe
8044 Console 0 35,184 K
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
6612 Console 0 6,104 K
The process cannot access the file because it is being used by another process.
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpbk ar32.exe
8044 Console 0 35,184 K
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
6612 Console 0 6,104 K
The process cannot access the file because it is being used by another process.
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpbk ar32.exe
8044 Console 0 35,176 K
The process cannot access the file because it is being used by another process.
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
6036 Console 0 6,104 K
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
7776 Console 0 6,104 K------>Here it did not gave the message
error level is
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
6036 Console 0 6,104 K
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
7776 Console 0 6,104 K
error level is
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
6036 Console 0 6,104 K
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
7776 Console 0 6,104 K
error level is
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
6036 Console 0 6,104 K
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
7776 Console 0 6,104 K
error level is
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
6036 Console 0 6,104 K
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpcd .exe
7776 Console 0 6,104 K
error level is
========================== =
The HOT_BACKUP.bat is not giving those messages: see:
echo error level is 0 1>>C:\oracle\Dba\logs\CMDB \hot_backu p_logs\log file.txt
C:\Program Files\Veritas\NetBackup\bi n>tasklist .exe /fi "IMAGENAME eq bpbkar32.e
xe" 1>C:\oracle\Dba\logs\CMDB\ hot_backup _logs\borr ame.txt
C:\Program Files\Veritas\NetBackup\bi n>tasklist .exe /fi "IMAGENAME eq bpcd.exe"
1>>C:\oracle\Dba\logs\CMDB \hot_backu p_logs\bor rame.txt
C:\Program Files\Veritas\NetBackup\bi n>findstr /i /s "bpbkar32.exe bpcd.exe" C:\
oracle\Dba\logs\CMDB\hot_b ackup_logs \borrame.t xt
C:\oracle\Dba\logs\CMDB\ho t_backup_l ogs\borram e.txt:bpbk ar32.exe
6044 Console 0 35,116 K
C:\Program Files\Veritas\NetBackup\bi n>if 0 EQU 0 (
echo Todavfa estß corriendo el envfo a Veritas 1>C:\oracle\Dba\logs\CMDB\ hot_ba
ckup_logs\Verificacion.log
echo error level is 0 1>>C:\oracle\Dba\logs\CMDB \hot_backu p_logs\log file.txt
Goto :Loop
) else (
echo Termin= el envio a Veritas 1>>C:\oracle\Dba\logs\CMDB \hot_backu p_logs\Ver i
ficacion.log
echo error level is 0 1>>C:\oracle\Dba\logs\CMDB \hot_backu p_logs\log file.txt
start C:\oracle\Dba\scripts\CMDB \hot_backu p_scripts\ hot_CMDB_b ackup_end. bat
Goto :Terminar
)
C:\Program Files\Veritas\NetBackup\bi n>call C:\oracle\Dba\scripts\CMDB \hot_backu
Test2.bat.txt
HOT-BACKUP.bat.txt
Also the writing of the borrame.txt is giving me sometimes the following messages that it is not giving in the original. I have attached both the first one with the additinal loop named "Queued", which is waiting for some process of veritas to showed up, because in some cases Veritas Queued the jobs if they are many at the same time and it has to "wait".
The other modification is the loop "Terminar", which "unified the Veritas log with the alter tablespace log.
Original is named HOT_BACKUP.bat and yours is Test2.bat.
C:\oracle\Dba\logs\CMDB\ho
6612 Console 0 6,104 K
The process cannot access the file because it is being used by another process.
C:\oracle\Dba\logs\CMDB\ho
8044 Console 0 35,184 K
C:\oracle\Dba\logs\CMDB\ho
6612 Console 0 6,104 K
The process cannot access the file because it is being used by another process.
C:\oracle\Dba\logs\CMDB\ho
8044 Console 0 35,184 K
C:\oracle\Dba\logs\CMDB\ho
6612 Console 0 6,104 K
The process cannot access the file because it is being used by another process.
C:\oracle\Dba\logs\CMDB\ho
8044 Console 0 35,176 K
The process cannot access the file because it is being used by another process.
C:\oracle\Dba\logs\CMDB\ho
6036 Console 0 6,104 K
C:\oracle\Dba\logs\CMDB\ho
7776 Console 0 6,104 K------>Here it did not gave the message
error level is
C:\oracle\Dba\logs\CMDB\ho
6036 Console 0 6,104 K
C:\oracle\Dba\logs\CMDB\ho
7776 Console 0 6,104 K
error level is
C:\oracle\Dba\logs\CMDB\ho
6036 Console 0 6,104 K
C:\oracle\Dba\logs\CMDB\ho
7776 Console 0 6,104 K
error level is
C:\oracle\Dba\logs\CMDB\ho
6036 Console 0 6,104 K
C:\oracle\Dba\logs\CMDB\ho
7776 Console 0 6,104 K
error level is
C:\oracle\Dba\logs\CMDB\ho
6036 Console 0 6,104 K
C:\oracle\Dba\logs\CMDB\ho
7776 Console 0 6,104 K
error level is
==========================
The HOT_BACKUP.bat is not giving those messages: see:
echo error level is 0 1>>C:\oracle\Dba\logs\CMDB
C:\Program Files\Veritas\NetBackup\bi
xe" 1>C:\oracle\Dba\logs\CMDB\
C:\Program Files\Veritas\NetBackup\bi
1>>C:\oracle\Dba\logs\CMDB
C:\Program Files\Veritas\NetBackup\bi
oracle\Dba\logs\CMDB\hot_b
C:\oracle\Dba\logs\CMDB\ho
6044 Console 0 35,116 K
C:\Program Files\Veritas\NetBackup\bi
echo Todavfa estß corriendo el envfo a Veritas 1>C:\oracle\Dba\logs\CMDB\
ckup_logs\Verificacion.log
echo error level is 0 1>>C:\oracle\Dba\logs\CMDB
Goto :Loop
) else (
echo Termin= el envio a Veritas 1>>C:\oracle\Dba\logs\CMDB
ficacion.log
echo error level is 0 1>>C:\oracle\Dba\logs\CMDB
start C:\oracle\Dba\scripts\CMDB
Goto :Terminar
)
C:\Program Files\Veritas\NetBackup\bi
Test2.bat.txt
HOT-BACKUP.bat.txt
ASKER
I have a question posted in this link because it is another server and executing in E drive:
03/28/10 11:30 PM, ID: 25580461 | Points: 250
Batch file - Executing - in Drive E: - The system cannot find the path specified
03/28/10 11:30 PM, ID: 25580461 | Points: 250
Batch file - Executing - in Drive E: - The system cannot find the path specified
Are you up and running now or do require further assistance?
Do
.
.
Loop
You need to use the GOTO statement like this (note the leading ':' (colon) character):
:Loop
.
.
Goto loop
(No need for leading ':' (colon) with the GOTO but won't hurt if you put one in as in the following):
:Loop
.
.
Goto :Loop