Hi,
Thanks for the continuous help. Directory path is /Oracle/TEST/oraarch and the extension of the log is *.dbf and script extension is also .sh so for my opinion it should work I will try and post results and only curios to know time parameter is mandatory, my ultimate purpose is when script run and it didn't find any logs then it should return 0 on sap side and SP scheduler event side as well.pls share your opinion.
Thanks
Prem
------Original Message------
Hello Prem,
my code will work with ksh and sh. I don't have a HP-UX system but I assume it will work with HP-UX, too as it is a standard shell script.
In my code you have to insert the path in which your logs are written, then your code will be executed only when one or more logs are present to backup. I don't know this path, it is defined in your database configuration.
If your script is executed every 6 hours, then change the value of the mmin parameter from -30 to -360 - I have done this in the example below.
I don't know the names of your logs, so please adjust the value of the name parameter.
Then the script should be something like this...
filecount=`find <path_to_logdirectory> -type f -name "*.log" -mmin -360 | wc -l`if [ $filecount -gt 0 ]then cat /dev/null>/oracle/script/DBarch_test.log su - oratest <<EOF brarchive -sd -c force -u / >> /oracle/script/DBarch_test.log EOFelse return 0fiSo, please play around with the script code and try some variations.
Best regards,
Jochen
------------------------------
Jochen Meixner
Principal Consultant Storage & Backup Solutions
ACT Gruppe
Duesseldorf, Germany
------------------------------
#StorageManagementandReporting#PrimaryStorage#Storage