Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hardcoding a destination path in my backup file script 1

Status
Not open for further replies.

bazil2

Technical User
Feb 15, 2010
148
DE
Can anyone please advise if the following is possible ...

I have a backup script (.bat file) shown below, that copies certain files on my computer to a backup location using a scheduled task.

At the moment, the script copies the files to an undesirable path, would it be possible to copy the backup files to H:\Backup\

Best regards

@echo off
REM *************************************************************************REM Program Title: backup.bat
REM Code Type : DOS Batch
REM Date : 2005-5-3
REM Called By : command line
REM Purpose : To backup DFE core configurations.
REM
REM Usage : backup [option] [filepath]
REM
REM default : backup will be created in %UNICORN_DATA% directory if filePath not provided.
REM
REM *************************************************************************

if "%MOBIUS_HOME%" == "" (
echo ERROR: MOBIUS_HOME not found in your environment.
echo you must set MOBIUS_HOME variable in your environment... exiting...
echo
goto EOF
)

if "%MYSQL_HOME%" == "" (
echo ERROR: MYSQL_HOMEnot found in your environment.
echo you must set MYSQL_HOME variable in your environment... exiting...
echo
goto EOF
)
if "%UNICORN_DATA%" == "" (
echo ERROR: UNICORN_DATA not found in your environment.
echo you must set UNICORN_DATA variable in your environment... exiting...
echo
goto EOF
)
if "%UNICORN_BASE%" == "" (
echo ERROR: UNICORN_BASE not found in your environment.
echo you must set UNICORN_BASE variable in your environment... exiting...
echo
goto EOF
)

::#######################
:: Setup the classpath
::#######################
set DEFAULT_DIR=%CD%
echo Checking configurations ...
call "%MOBIUS_HOME%\tools\reports\setupReportCP.bat"

cd /D %MOBIUS_HOME%\exe\tomcat\webapps\prodflow\web-inf
echo --------------------------------
%JAVA_HOME%\bin\java -cp %CLASSPATH% -Dtomcat.home=%MOBIUS_HOME%\exe\tomcat -Dmobius.home=%MOBIUS_HOME% com.hp.cp.psp.utils.backuprestore.Backup %1
goto EOF

:EOF
if not "%drive_letter%" == "" (
subst /d %drive_letter%
)
set CLASSPATH=
set cp=
set drive_letter=
cd /D %DEFAULT_DIR%



 
If you are trying to back up a server running apache, you might be better off asking in an apache forum here. With that said, how is the undesirable path being passed in? As parameter %1? If so just change the parameter when the batch file is called.
 
Many thanks!

I'll investigate that; I think the web server is tomcat, I also noted that there is a secondary .bat nested in this script that I need to investigate.

Best regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top