I need to write a batch script to create a oracle export with timestamp and copy the file to another server but want to make sure it is copied then send an email whether it is successful or not. So I have been able to generate export file as I use a variable for file name but the code to check if the file exists on the other server does not get executed. I would appreciate if someone helps with this. This is a batch file runs nightly. I am totally new to dos programming.
I have something similar to below but if section does to get work:
Code: Select all
dumpfile_xx=full_exp-%date:~4,2%%date:~7,2%%date:~10,4%.dmp
logfile_xx=full_exp-%date:~4,2%%date:~7,2%%date:~10,4%.log
expdp db_name/db_pswd DIRECTORY=DATA_PUMP_DIR dumpfile=%dumpfile_xx% full=y logfile=%logfile_xx%
if exist \\xxx\xxx\%dumpfile_xx% (
echo file exists
) else (
echo file doesn't exist
)