Robocopy Copy Script

Posted on 2011-10-12
Last Modified: 2012-05-12
Hi Guys,

I need some assistance with the preparation of a Robocopy script.

The requirement is to only copy the Files/Folders for the current week from the Source to Destination and thereafter the Robocopy should only copy new files only.

Please advise.

Thanks guys
Question by:japitsolution

    Author Comment

    To add to above I need the data to be copied across from 4 Servers to a central server.


    Source Files are at C:\Data on Server 1, Server 2, Server 3 & Server 4

    Destination folder is at: \\Server5\e$\data

    It would be handy to make 1 script with all above servers.

    Thanks Guys
    LVL 22

    Accepted Solution

    robocopy \\server1\c$\data \\server5\e$\data\server1 *.* /e /m
    robocopy \\server2\c$\data \\server5\e$\data\server2 *.* /e /m
    robocopy \\server3\c$\data \\server5\e$\data\server3 *.* /e /m
    robocopy \\server4\c$\data \\server5\e$\data\server4 *.* /e /m

    /e = copy sudfolders also
    /m = copy only files with Archive attribute set, then remove/reset attribute (this will only copy new/modified files)
    you can add other switches if you like, but that should be the basic command
    LVL 22

    Expert Comment

    the first copy you probably don't want the /m switch, afterwards add the /m switch

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Experts-Exchange users below are the steps you can follow to upgrade your Lync server to latest CU's or cumulative updates. Note: Perform it during non-production hours.   Step 1: Backup your lync and SQL server database. Follow below article: h…
    The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now