Avatar of baleman2
baleman2
 asked on

Batch File to move Folders / Files to USB devices

We have an external Hard Drive (Drive E:) that is shared by 4 end users, i.e., all end users save documents to this device.   This device is never taken off the network.  Although Carbonite is being used for offsite storage of all content on this drive, we'd like to have a local backup solution also.
Our intention is to have 2 USB hard drives that would be plugged in to an end users computer in late afternoon just before our end users leave work.  Device USB1 and Device USB2 would be used on Monday for an initial copy of the Folders / Files from Drive E:.   Then, the devices would be used on alternative nights from that time on.
I need a batch file that would:
   1) On Monday, copy all files from Drive E: to USB1 and USB2
        a) Folder and File Structure would have to be duplicated exactly
 I need a different batch file that would:
   1) On Tuesday late afternoon, only APPEND to Device USB1 those files that had been changed since the files were last saved on Device USB1.
   2) On Wednesday morning, Device USB1 would be unplugged and stored in a safe place.
       a) Device USB2 would be plugged in and be ready for use late afternoon.
   3) On Wednesday late afternoon, only APPEND to Device USB2 those files that had been changed since the files were last saved on Device USB2
   4) On Thursday morning, Device USB2 would be unplugged and stored in a safe place
       a) Device USB1 would be plugged in and be ready for use late afternoon.
   5) Process would continue on all workdays.

In the event of disaster to Drive E: at any time during the day, at worst we'd have a copy of Drive E: on either USB1 or USB2 that would be missing only the current day's Folders / Files.
StorageNetworkingStorage HardwareWindows BatchScripting Languages

Avatar of undefined
Last Comment
hypercube

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
hypercube

THIS SOLUTION 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
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Duncan Roe

I would use robocopy. It's a standard Microsoft utility, should be on your system already and has extensive help.
baleman2

ASKER
This worked out best.
hypercube

Good to hear.  You can also trigger SecondCopy profiles using batch files.  I do that when I want to log actions.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck