Question : File corrupt after copyiing through VPN

Hi!

I have created a batch file that first creates a rar archive with database backups and then copies it to remote office which is connected through VPN. The problem is that when I open the archove file in most cases it's corrupt. When I double click the file WinRAR thoughs an error: (!   E:\Backup\backup.rar: The file "???" header is corrupt). When I script the same job but to copy it to another server within the same network the copied file is OK. But it seems to get corrupt only when copied through VPN.
So, I need some advise here. Should I use some other solution to make sure that the copied file is working? Like FTP? If FTP then which soft is better for scripted/automated job? Or there's some better solution for this?

Answer : File corrupt after copyiing through VPN

I've updated the batch file, just make sure that sync is in the filepath or edit the batchfile accordingly.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
@echo off
net use m: \\10.10.10.10\Backup_DB$ backup /USER:DOMAIN\BackupUser /PERSISTENT:NO
if exist E:\SQL\BACKUPRAR\backup.rar del E:\SQL\BACKUPRAR\backup.rar
cd "c:\Program Files\Winrar\" 
winrar a -rr10p E:\SQL\BACKUPRAR\backup.rar E:\SQL\BACKUP
copy /V /Y /Z E:\SQL\BACKUPRAR\backup.rar m:\
net use n: \\itudc01\BACKUP\MEEAST_ITU backup /PERSISTENT:NO
cd "c:\Program Files\Winrar\" 
copy /D /V /N /Y E:\SQL\BACKUPRAR\backup.rar n:\
sync m n
net use m: /DELETE
net use n: /DELETE
Random Solutions  
 
programming4us programming4us