I use Robocopy for backup Samba shares into local drive and vice versa. To sync remote share with local folder I use PS script
$Path = Split-Path "\\192.168.1.100\asuscloud\*"
$Dest = "E:\back_fold\asuscloud\"
robocopy $Path $Dest /B /MT:64 /IS /Z /FP /MIR /TEE /NP /FP /NDL
To exclude some subfolder one can use /XD
switch
$Path = Split-Path "\\192.168.1.100\asuscloud\*"
$Dest = "E:\back_fold\asuscloud"
robocopy $Path $Dest /B /MT:64 /IS /Z /FP /MIR /TEE /NP /FP /NDL /XD "\\192.168.1.100\asuscloud\subdir"
However, this syntax doesn't work for the host and shares of this host
$Path = Split-Path "\\192.168.1.100\*"
$Dest = "E:\back_fold\"
robocopy $Path $Dest /B /MT:64 /IS /Z /FP /MIR /TEE /NP /FP /NDL /XD "\\192.168.1.100\asuscloud\"
It throws
------------------------------------------------------------------------------>-
ROBOCOPY :: Robust File Copy for Windows
Started : Saturday, September 1, 2018 8:46:23 PM Source : D:\back_fold\ Dest -
Files : .
Exc Dirs : \192.168.1.100\asuscloud
Options : . /FP /NDL /TEE /DCOPY:DA /COPY:DAT /Z /NP /IS /MT:64 /R:1000000 /W:30
ERROR : No Destination Directory Specified.
I want to exclude two shares of a host and sync others into local folder.
How to achieve this?
UPDATE: nbtstat -A 192.168.1.100
C:\Windows\system32>nbtstat -A 192.168.1.100
Ethernet:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
Ethernet 2:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
Bluetooth Network Connection:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
Wi-Fi:
Node IpAddress: [192.168.1.105] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
---------------------------------------------
PASCAL <00> UNIQUE Registered
PASCAL <03> UNIQUE Registered
PASCAL <20> UNIQUE Registered
☺☻__MSBROWSE__☻<01> GROUP Registered
WORKGROUP <1E> GROUP Registered
WORKGROUP <00> GROUP Registered
WORKGROUP <1D> UNIQUE Registered
WORKGROUP <1B> UNIQUE Registered
MAC Address = 00-00-00-00-00-00
Local Area Connection* 3:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
NET VIEW \\192.168.1.100
C:\Windows\system32>NET VIEW \\192.168.1.100
Shared resources at \\192.168.1.100
Pascal
Share name Type Used as Comment
-------------------------------------------------------------------------------
asuscloud Disk data's asuscloud in External USB3.0
backup Disk data's backup in External USB3.0
downloads Disk data's downloads in External USB3.0
dropbox Disk data's dropbox in External USB3.0
entware Disk data's entware in External USB3.0
os Disk data's os in External USB3.0
The command completed successfully.