Simplfying backing up files with some code or a utility/program/Windows feature

Muse

Lifer
Jul 11, 2001
40,871
10,222
136
I figure this is a good place to post this, although there's likely a utility, program or even a Windows feature that will suffice here.

I routinely backup or transfer files that have changed from one system to another. For instance, I have a laptop elsewhere that hopefully mirrors some data folders on my NAS or on a drive on this machine. What I typically do is look on my flash drive to determine when I last copied files to it (date of most recent files), then look in the folder with the most recent info on either my NAS or a data folder on this machine, highlight the newer files, copy them to clipboard and paste onto my flash drive. When I get to the other machine, I copy/paste the newer files. This seems more tedious than it need be. I figure I could work up DOS batch files to help with this but that there are probably neater ways to do it.

I took DOS classes many years ago, have some big books on it, program with Visual Foxpro a lot, but the VFP Copy Command appears to be too simple to help with this, I don't see any switches in it at all.

What do you think?
 
Last edited:

sm625

Diamond Member
May 6, 2011
8,172
137
106
A simple batch file is all that is needed:

Code:
xcopy C:\Dir1\*.* H:\Dir1 /d /e /y /v
xcopy C:\Dir2\*.* H:\Dir2 /d /e /y /v
rem and so on and so on for every folder

pause

:END
 

Muse

Lifer
Jul 11, 2001
40,871
10,222
136
A simple batch file is all that is needed:

Code:
xcopy C:\Dir1\*.* H:\Dir1 /d /e /y /v
xcopy C:\Dir2\*.* H:\Dir2 /d /e /y /v
rem and so on and so on for every folder

pause

:END
Thank you, I'll give that a try. I only need maybe 1/2 dozen lines or so.
 

Muse

Lifer
Jul 11, 2001
40,871
10,222
136
A simple batch file is all that is needed:

Code:
xcopy C:\Dir1\*.* H:\Dir1 /d /e /y /v
xcopy C:\Dir2\*.* H:\Dir2 /d /e /y /v
rem and so on and so on for every folder

pause

:END
I like it, but I think I'll skip the /e switch because there's a bunch of stuff I don't want copied. When I do want a subdirectory copied I'll specify that with a separate line.

Edit: I had to write two of them because my laptop assigns either E or F to the thumb drive. I have one of them running right now.

One of them reads:

xcopy D:\agent\data\*.* F:\agent\data /d /y /v
xcopy W:\data\fox\dj\*.* F:\fox\dj /d /y /v
xcopy W:\data\fox\dj\programs*.* F:\fox\dj\programs /d /y /v
xcopy W:\data\ans\*.* F:\ans /d /y /v
xcopy W:\data\ans\sen*.* F:\data\ans /d /y /v
rem and so on and so on for every folder

pause

:END
- - -
Well, you get the idea.
 
Last edited: