Server A is a production database server that lives in a remote data centre, has an IP address of 192.168.1.22 and belongs to domain "prodDom". ProdUser is a login on the domain with permissions to read the backup file location.
Server B is a backup NAS server that lives local data data centre and belongs to domain "officeDom".
There is a site to site VPN between the sites, but the servers belong to different unrelated domains that have no trust relationship. Server A produces a backup file each day that I need to copy to Server B but Server B does not have file share permissions to read from Server A without explicitly setting them.
Set LogFile="d:\backupCopy.log"
net use \\192.168.1.22\BakShare password /user:prodDom\prodUser /PERSISTENT:YES > %LogFile%
net use >> %LogFile%
whoami >> %LogFile%
Set Source=\\192.168.1.22\BakShare
Set Dest=d:\backups
Robocopy "%Source%" "%Dest%" /R:10 /IPG:10 /MIR >> %LogFile%
Robocopy notes:
/R:10 reduces the number of retry from the high default value - this means that the script will not get stuck in a loop for hours and hours
/IPG:10 causes a 10ms delay between each packet. It's by no means a guarentee, but I've typically seen this throttle the network usage on a copy job to around 30% of a 100mb/s lan connection.
No comments:
Post a Comment