Windows Search to Backup Only New Files


STEP 1: FIND FILE OF INTEREST

example:  have already synched F:\Pictures\2017 and need to find all other files in F:\Pictures that have been modified since the last backup on May 1, 2017
In windows Explorer, navigate to the F:\Pictures folder and in the search box in the upper right paste the string below to find all files excluding folders [size > 0] with date after last backup not in 2017 folder or it's children
size:>0 AND datemodified:>5/1/2017 AND NOT folder:"*\2017\*" AND NOT folder:"*\2017*"

more information here

In the results pane Ctrl+A to select all, then Shift+Right click and select Copy as path.  Open EditPad and paste into a new document.  Each line will contain one filename surrounded by double quotes, such as
"F:\Pictures\2010s\2011\sample\example image.JPG"


STEP 2: GREP RESULTS TO CREATE LIST OF FILE COPIES

Note:  This step may need to be modified to account for overwriting old files

Search for
"(.):(.*)\\(.*)"

Replace with this string, assuming H is the USB drive /  destination drive
ROBOCOPY "\1:\2" "H:\\COPYTEST\2" "\3" /LOG+:H:\\COPYTEST\LOG.TXT

Save the file as a .BAT file.



STEP 3: PRIME THE PUMP BY MAKING LOG FILE

H:\COPYTEST\LOG.TXT - CREATE IT AND PUT SOME TEXT IN IT


STEP 4:   RUN .BAT FILE


STEP 5: REVIEW LOG FILE


^((?!Files :).)*
[BLANK]


^\r\n
[BLANK]


^\r
[BLANK]


^((?!Files : ).)* -- GETS RID OF FILENAMES
[BLANK]


^\r\n
[BLANK]


MORE INFO

the idea is explained in detail here: copy search results preserve folders

 

last updated:    Tue 2017-05-23 7:35 AM