?
Solved

Robocopy Question

Posted on 2016-08-30
5
Medium Priority
?
151 Views
Last Modified: 2016-09-06
I want to copy all shares from one server to a folder on another.

My syntax is: robocopy \\Library2 \\WSCALFS\Company\Library\ /MIR /W:20 /R:15

and this is the output:

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

  Started : Tue Aug 30 12:19:47 2016

2016/08/30 12:19:47 ERROR 161 (0x000000A1) Getting File System Type of Source \\Library
\
The specified path is invalid.

   Source - \\Library2\
     Dest : \\WSCALFS\Company\Library\

    Files : *.*

  Options : *.* /S /E /COPY:DAT /PURGE /MIR /R:15 /W:20

------------------------------------------------------------------------------

2016/08/30 12:19:48 ERROR 161 (0x000000A1) Accessing Source Directory \\Library2\
The specified path is invalid.
0
Comment
Question by:aclaus225
[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 25

Accepted Solution

by:
NVIT earned 1000 total points
ID: 41777058
Assuming \\Library2 is the server name, you need to specify the share name, e.g. \\Library2\share
0
 
LVL 31

Expert Comment

by:Scott C
ID: 41777060
Here is a script I use for just that thing...This is nice because you are sent an email when the process starts and when it ends.  You can use Task Manager to start the migration at a specified time and be notified when it starts.

BTW...this is a PowerShell script.

##############################################################################
# Migrate files between servers .v 2.0.1
#
# !!!!! /B switch must be at the end of the command string or it will not work.  Files not owned will timeout and fail to copy !!!!!
#
# Use /COPYALL option to migrate ACL and Auditing Info (for production shares, servers must be in same domain)
# Use /COPY:DATO option to migrate Data, Attributes, Timestamp, Owner (Not Security, aUditing Info) (for backup copy of full system)
#
##############################################################################
$From = "user@company.com"
$To = "user@company.com"
$Cc = "user@company.com"
$Subject = "C Drive copy has started"
$Body = "C Drive copy has started"
$SMTPServer = "smtp.appriver.com"
$SMTPPort = "2525"
# $Attachment = "C:\temp\Some random file.txt"
#
Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject `
-Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl `
-Credential $cred # -Attachments $Attachment
##############################################################################

date

$source=@("\\dc1\c$")
$destination=@("e:\robocopy\dc1\c")
$logfile="e:\robocopy\robocopy_dc1_C.log"

robocopy $source $destination /COPY:DATO /E /Z /R:2 /W:3 /NP /XJ /PF /LOG+:$logfile /XF .rnd AUTOEXEC.BAT boot.ini bootmgr BOOTNXT CONFIG.SYS IO.SYS MSDOS.SYS NTDETECT.COM ntldr pagefile.sys /XD "$source\boot" "$source\CIntApps" "$source\Config.Msi" "$source\Dump" "$source\$Recycle.bin" "$source\Documents and Settings" "$source\RECYCLER" /B

attrib +r $logfile
attrib -s -h -r $destination
 
##############################################################################
# $Attachment = "C:\temp\Some random file.txt"
$Subject = "C Drive copy has completed"
$Body = "C Drive copy has completed"
#
Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject `
-Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl `
-Credential $cred # -Attachments $Attachment
##############################################################################
0
 
LVL 16

Assisted Solution

by:FOX
FOX earned 500 total points
ID: 41777068
It doesn't like \\library2, secondly are you copying everything inside library 2 to that destination?  If so you want to use the below.  Your getting security settings, and preserving timestamps

\\library2\  \\WSCALFS\Company\Library\  *.* /S /E /COPYALL /DCOPY:T  /MIR /R:15 /W:20 /LOG+:c:\temp\copylog.txt /TEE

If it doesn't like library2, use the IP of library2 and the ip of wscalfs

example
\\ipaddressoflibrary2\ \\ipaddressofwscalfs\Company\Library\ *.* /S /E /COPYALL /DCOPY:T  /MIR /R:15 /W:20 /LOG+:c:\temp\copylog.txt /TEE

ref link:  https://techjourney.net/robocopy-syntax-command-line-switches-and-examples/
0
 

Author Comment

by:aclaus225
ID: 41777081
Correct, I am trying to copy all of the shares from Library2 to a folder on WSCALFS.
0
 
LVL 30

Assisted Solution

by:serialband
serialband earned 500 total points
ID: 41777396
Is Library2 the share name or the server name?  What are your servers?  What are your shares?

The syntax is as follows:
robocopy.exe \\Server1\SharedFolder1 \\Server2\SharedFolder2   /MIR /W:20 /R:15
You're either leaving off the share name or the server name for your source.

If the Library2 folder is on a local disk, you still have to specify the local disk name along with the full path to Library2.
robocopy.exe D:\Library2 \\Server2\SharedFolder2   /MIR /W:20 /R:15
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

770 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