# Need batch file to backup files



## prem_ciet (Jan 7, 2010)

Hi All,

I'm new to this forum. I need a batch file to copy files from one drive to another.Say if there are 100 files that needs to be backed up one by one. Suppose incase the copy of the third file fails, then the script should send me an e-mail stating the reason for the failure and then the script should exit.

Please help me in generating this script.

Thanks in advance.

regards,
Prem


----------



## Elvandil (Aug 1, 2003)

Why not just use a program:

Free backup applications:

FreeFileSync (Free, open-source folder comparison and synchronization utility)
Karen's Replicator
Cobian backup
SyncBack
DeltaCopy (Works like Vista's file transfer and only copies changed bytes so whole file not copied.)
Allway Sync
VersionBackup
JaBack
WinBackup


----------



## Squashman (Apr 4, 2003)

Why would you want it to exit if any file fails to copy?

I personally would do Elvandil suggestion but if you really want it done in batch, then you would probably want to sue Robocopy which should be on your server already depending which Windows server you are running. If not you can load it on with the Resource Kit.

Robocopy has logging features and retry options.

If you need the log emailed to you there are several programs you can install to integrate with the batch file.


----------



## prem_ciet (Jan 7, 2010)

Hi,

Thanks for your responses. Basically Im an Oracle DBA and trying to automate the cold backup of database. We already have a batch file which will shutdown the db, backup the datafiles and then starts up the db. But the problem here is when one copy fails for some reason and if the other copy command runs successfully we wont be able to restore the db.

So our aim to backup all the files properly.

Please help me in implementing this.

regards,
prem


----------



## sysctls (Jan 7, 2010)

look at Backup Exec by Symantec...


----------



## Squashman (Apr 4, 2003)

sysctls said:


> look at Backup Exec by Symantec...


Backup Exec is a great product. When you are talking about backing up critical data like a database you shouldn't take shortcuts. Buy a real backup solution.

I have never used Oracle, so I am wondering if it has a builtin backup capability.


----------

