Avatar of mlcktmguy
mlcktmguyFlag for United States of America

asked on 

Copy to another drive, retain directory structure and old files

I have my data being backed up to cloud storage but I also run my own batch backup locally for critical files and directories.  Currently I am using 'xcopy'.  This command preserves and copies sub-directories.

xcopy "i:\My Documents\Access_Databases\Delinq\*.*" "J:\Delinq" /s /y /f

One thing neither my cloud backup or by batch backup does is retain files on the destination drive that I have erased from the origin drive.

For example, my I drive contains:

File1
File2
FIle3

I execute my 'xcopy' command, then FIle1, FIle2 and FIle3 are on J: drive.

I erase 'FIle2' from the I drive and execute the xCopy again.

Now only files File1 and FIle3 are on the J: drive.

I would like to use the J: drive a as a repository for any files ever copied from the I drive, not just the files currently on the I: drive.  So if I delete File2 from the I drive, it will still be on the J: drive.

I created the xcopy so long ago I don't remember what the specific options '/' do.

Is there a command I can build into my batch backup that will copy all current files to the destination drive, retaining the directory structure and keep previously copied files that no longer exist on the origin drive?
Windows OS

Avatar of undefined
Last Comment
mlcktmguy
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of mlcktmguy
mlcktmguy
Flag of United States of America image

ASKER

My mistake.  When I reviewed the results you are 100% correct.

Thanks
Windows OS
Windows OS

This topic area includes legacy versions of Windows prior to Windows 2000: Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions including Windows Mobile.

129K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo