+ Reply to Thread
Results 1 to 8 of 8

Thread: Xcopy

  Share/Bookmark
  1. #1

    Reputation

    Join Date
    Feb 2008
    Posts
    74
    Thank Post
    23
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Smile Xcopy

    Hi I need a script to copy everything in one folder to another server, if the file is already on the destination I want it not to copy. Is this possible

  2. #2

    Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation

    Join Date
    Jul 2007
    Location
    Rural heck
    Posts
    1,816
    Thank Post
    58
    Thanked 239 Times in 187 Posts
    Rep Power
    68

    Default

    You should be able to do this with Robocopy.

  3. #3

    Reputation

    Join Date
    Feb 2008
    Posts
    74
    Thank Post
    23
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Default Thanks

    Thanks I have kust figured this out will the following work

    ROBOCOPY \\Server1\reports \\Server2\backup *.doc /S


    Where do I need to put robocopy or is it built into windows??

  4. #4

    Reputation Reputation Reputation Reputation Reputation Reputation Reputation
    TonyRidal's Avatar
    Join Date
    Aug 2007
    Location
    South Cumbria
    Posts
    583
    Thank Post
    221
    Thanked 78 Times in 62 Posts
    Rep Power
    34

    Default

    what you need isn't xcopy, but robocopy.exe (yes, really!) a copy is attached.

    I've attached it to this message - just unzip and stick it in your Windows folder so the Path points to it then from a command prompt type "robocopy /?" to get all the parameters, of which there are many!

    use "/mir" with extreme care, it's particularly powerful but potentially destructive!!
    Attached Files

  5. Thanks to TonyRidal from:

    itgeek (04-06-2009)

  6. #5

    Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,146
    Thank Post
    133
    Thanked 185 Times in 71 Posts
    Rep Power
    43

    Default

    This should do it for you:

    robocopy.exe [source] [destination] [flags]

    robocopy.exe /? will giove you the other [flags] that you can use.

  7. Thanks to ICTNUT from:

    itgeek (04-06-2009)

  8. #6

    Reputation

    Join Date
    Feb 2008
    Posts
    74
    Thank Post
    23
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Default Thanks

    Thanks

    I will download and have a play.


    Just one more question?

    If I wanted to delete files in a folder more that 5 days old, does any no how to do this?

    Thanks

  9. #7

    Reputation Reputation

    Join Date
    Nov 2007
    Location
    Leeds
    Posts
    217
    Thank Post
    23
    Thanked 33 Times in 30 Posts
    Rep Power
    11

    Default

    I found this VBS script somewhere on the net, and use it to delete files more than 30 days. Just edit the path and days (calcresult)...
    Dim i, fso, f, f1, sf, BasePath, CalcResult, fNameArray()
    BasePath = "T:\Docs Backups\"
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFolder(BasePath)
    Set sf = f.SubFolders
    For Each f1 in sf
    CalcResult = DateDiff("d",f1.DateCreated,Now)
    if CalcResult > 30 then
    ReDim preserve fNameArray(i)
    fNameArray(i) = f1.Name
    i = i + 1
    end if
    Next

    For Each fName in fNameArray
    FSO.DeleteFolder(BasePath & "\" & fName)
    Next

  10. Thanks to terrorvis from:

    itgeek (04-06-2009)

  11. #8

    Reputation Reputation Reputation Reputation Reputation Reputation Reputation
    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    1,495
    Thank Post
    24
    Thanked 93 Times in 62 Posts
    Rep Power
    39

    Default

    You could also use RichCopy - robocopy's replacement from here

    It does the same, has a GUI as well as command line and is multi-threaded - so should be quicker

  12. Thanks to SpuffMonkey from:

    TonyRidal (05-06-2009)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. samba, acls, xcopy
    By CyberNerd in forum *nix
    Replies: 1
    Last Post: 30-05-2007, 02:50 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts