?
Solved

Folder Copy

Posted on 2009-05-14
5
Medium Priority
?
343 Views
Last Modified: 2013-11-10
Each night I need to copy certain sub folders from one server to another.  How can I set up the copy?  For example, I have a folder structure as follows:  Main Folder called Aircraft with subfolders called 011 etc, then subfolders under that called A, B, C with subfolders under those called Drafts, Final Documents, Word.   I need to copy the structure over to another server, but the only files I need are the ones under Final Documents.  Does anyone have a idea on how to do this?
0
Comment
Question by:bduenges
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Accepted Solution

by:
djpazza earned 2000 total points
ID: 24385485
yes try using this program SyncBack Freeware

http://www.2brightsparks.com/downloads.html

It has loads of options for backing up folders, syncing and can even send you email alerts.
0
 
LVL 21

Expert Comment

by:AmazingTech
ID: 24385849
Copy the structure over and then the files.

Structure:

XCOPY /t /e \\server1\share \\server2\share

Files only from Final Documents. My first thought is to use XCOPY /L and find Final Documents. In a for loop copy these files.

for /f "tokens=*" %%a in ('xcopy /L /s "\\server1\share" "\\server2\share" ^| find /i "\Final Documents\"') do
SETLOCAL ENABLEDELAYEDEXPANSION
Set Server1Path=\\server1\share
Set Server2Path=\\server2\share
Set LookFor=\Final Documents\
 
XCOPY /t /e "%Server1Path%" "%Server2Path%"
for /f "tokens=*" %%a in ('xcopy /y /L /s "%Server1Path%" "%Server2Path%" ^| FIND /i "%LookFor%"') do (
    Set Destination=%%a
    Set Destination=!Destination:%Server1Path%=%Server2Path%!
    copy /y "%%a" "!Destination!"
)

Open in new window

0
 
LVL 15

Expert Comment

by:Rob Stone
ID: 24385871
xcopy can be used to copy the folder structure, then you can create a batch file to copy just the files from the folders you want with xcopy as well.
0
 
LVL 85

Expert Comment

by:oBdA
ID: 24388832
If you only have those two subfolders you're not interested in (or, say, a limited amount of folders you don't want, with known names), a relatively simple robocopy command will do the trick.
Unfortunately, robocopy doesn't have an "include dirs" switch, you can only exclude folders.
robocopy.exe D:\test\test\aircraft D:\temp\aircraft /L /e /xd "drafts" "word"
You can run it with /L for testing, which will only list the files and folders, but not actually copy anything.
0
 

Author Closing Comment

by:bduenges
ID: 31581478
This Product worked great! Thanks!
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question