×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

script to copy a windows Server backup fiolder contents

script to copy a windows Server backup fiolder contents

script to copy a windows Server backup fiolder contents

(OP)
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.....

RE: script to copy a windows Server backup fiolder contents

(OP)
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.....

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close