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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script to copy a windows Server backup fiolder contents

Status
Not open for further replies.

Billz66

Technical User
Feb 21, 2010
2,079
AU
Not sure if this is the correct forum but ill give it a go
currently have a Windows Server 2019 Datacentre server doing daily windows backup to a NAS folder ( this is working)
on same server i have a task scheduler task triggered by backup success that sends an email ( also working)

then it runs a batch file to
remove mapping for drive X (destination of windows backup = source) (working)
remove mapping for drive Z ( mapped to day folder = destination) (working)
map a new drive to a day folder depending upon the day of the week (working)
remove the contents (Old data) (working)
robocopy the contents of the source to the destination and write to a log

robocopy "x:\FP-01 " "z:\FP-01 "/E /j /IM /r:60 /w:5 /MIR /MT:1 /LOG:C:\BackupScript\Backup-copy-Mon.txt

looks like vhdx files are copied with no issues
( for example) 822b06d5-5038-4700-aca2-f190ca231bd1.vhdx

xml files fail to copy
for example dfff6e9b-c236-4c97-9fd6-9a07ded25ad0_AdditionalFilesc3b9f3c7-5e52-4d5e-8b20-19adc95a34c7.xml)

common error is similar to the one below

New File 244114 X:\CurrentBackups\FP-01\WindowsImageBackup\Tie-FP01\Catalog\BackupGlobalCatalog Retrying...
2023/04/05 20:08:13 ERROR 2 (0x00000002) Changing File Attributes X:\CurrentBackups\FP-01\WindowsImageBackup\Tie-FP01\Catalog\BackupGlobalCatalog
The system cannot find the file specified.

Destination is a QNAP device

i have tried various robocopy parameters , none of them seem to work

can someone suggest an alternate method - perhaps using powershell instead of robocopy


If I never did anything I'd never done before , I'd never do anything.....

 
had endless issues with Powershell copy-item and unc paths
ended up moving the backup using get-childitem | move-item
seems to be ok so far

If I never did anything I'd never done before , I'd never do anything.....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top