• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Window robocopy script for specific function !!!!

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

userquery

New Member
Joined
Apr 21, 2016
one of our group dumps daily report files under new folder created each day in yyyymmdd format on shared drive

Source:

\\<Server1>\temp\20160401
\\<Server1>\temp\20160402
\\<Server1>\temp\20160403

I need robocopy script to be created to copy only latest date folder and its files from above source to destination share drive below

Destination:


\\<Server2>\all reports\report



Daily expected result should be (copying yesterday's folder only to destination)

on April 02, 2016

\\<Server2>\all reports\report\20160401


on April 03, 2016

\\<Server2>\all reports\report\20160402


on April 04, 2016

\\<Server2>\all reports\report\20160403


Have tried below robocopy script and i know there must be a some date logic to be included, instead of picking yesterday's folder only it copies all folders.


robocopy "\\<Server1>\temp" "\\<Server2>\all reports\report" /S
 
Back