A file copy utility for Windows®
SharePoint® Services
Copyright © 2004-2006
BluedogLimited.com
Published September 10,
2006
All rights
reserved.
Exclude files and directories. 4
Authentication and user credentials. 4
DavCopy.exe is file copy utility which utilizes WebDAV as its transport protocol and is specifically designed to operate against a Windows® SharePoint® Services server.
DavCopy.exe is command line driven.
.Net Framework v1.1
Copy the executable to a local hard drive. The tool requires no other setup.
This application is released as-is. Use at your own risk.
Please visit http://www.bluedoglimited.com/Downloads for additional help.
DavCopy.exe requires two command line parameters in order to operate. Various options can be used to customize behavior.
Usage: DavCopy.exe <pattern> <destination> [options]
|
Option |
Description |
|
<pattern> |
Specifies the file(s) to copy, relative to the current folder. |
|
<destination> |
Specify the destination folder. |
|
[options] |
Described below… |
DavCopy.exe is designed to copy files relative to the current directory.
The resulting file name is a merge of the two mandatory parameters - <pattern> and <destination>.
For example,
Command:
DavCopy.exe test\folder\readme.doc “http://server.com/shared
documents/”
Result:
File ‘readme.doc’ is copied to folder http://server.com/shared
documents/test/folder/
By default, DavCopy.exe does not overwrite files. If it finds an existing file at the destination folder, the file will be marked as ‘Skipped’.
The following options can be used to control when and how files are overwritten and/or deleted:
|
Option |
Description |
|
/o |
Specify that existing files are to be overwritten. Files are not deleted beforehand. |
|
/fd |
Delete the existing file before copying the newer file. This is useful in situations when you wish to retrigger
the “New!” announcement within a SharePoint
document library or list. |
Performance of the tool is directly related to the amount of bandwidth between you and your server. Additionally, server use can also affect performance.
The following options can be used to better optimize tool performance:
|
Option |
Description |
|
/T:n |
Specify the amount of time each request is given before a timeout is triggered. |
|
/RD:n |
Specify the number of milliseconds to delay between file transactions. This option is extremely valuable in situations where you are copying a large number of small files. In such a case, you may run into a problem where a connection failure occurs after a given number of requests have been processed. This failure point is entirely dependent upon the server’s capacity. If you find this option is necessary, try small values (i.e. 25-50 ms) and work your way upward. |
By default, DavCopy.exe will only copy files contained within the current directory.
The following options can be used to control recursive behavior:
|
Option |
Description |
|
/S |
Copies directories and subdirectories except empty ones. |
|
/E |
Copies directories and subdirectories, including empty ones. |
DavCopy.exe can be instructed to copy only files with the archive attribute set.
|
Option |
Description |
|
/A |
Copies only files with the archive attribute set, doesn't change the attribute. |
|
/M |
Copies only files with the archive attribute set and then resets (turns off) the archive attribute in the source files. |
When using a wildcard file pattern, you may find it helpful to exclude certain files and directories.
The following options can be used to control exclusions:
|
Option |
Description |
|
/XF file
[file] |
Exclude files matching given names, paths and wildcards. |
|
/XD dir
[dir] |
Exclude directories matching given names, paths and wildcards. |
By default, DavCopy.exe will use the current user’s credentials for authentication against the target server. In the event the target server is using either Basic authentication or resides behind a proxy server which does not allow NTLM credentials to pass through, you must provide the credentials.
The following options can be used to specify user credentials:
|
Option |
Description |
|
/USER:x |
Specify the user name needed to access the destination. The user can have the form of 'domain\user' or 'user@fully.qualified.domain' |
|
/PASSWORD:x |
Password for the associated user account. If not specified but the ‘/user’ option is used, the user will prompted for a password. |
As secondary check to ensure the file was properly copied to the server, the following option can be specified:
|
Option |
Description |
|
/V |
Verify file size on server matches the local file size. If it does not the copying process is terminated. This is more of a debugging aid. Please note that using this parameter will result in one additional server query per file; thus, slowing down the entire copy process. |
The following return values are generated:
|
Return value |
Description /
Condition |
|
-2 |
Unexpected exception caused the application to fail. |
|
-1 |
Help was requested and/or an invalid parameter was provided. |
|
0 |
All files and folder were copied and/or created. |
|
1+ |
Total number of files and folders categorized as ‘Skipped’ or ‘Mismatched’. |
Once all files have been processed, DavCopy.exe will produce a summary report. All transactions are categorized into one of four areas:
|
Category |
Description |
|
Copied |
Files copied and folders either processed and/or created. |
|
Files which were not copied because …
Folders which were not processed because
| |
|
File on the local system exists as a folder on the server. Folder on the local system exists as file on the server. | |
|
Deleted |
File deleted |
The categories are tallied in terms in hit count, time duration, and byte count.
The following example shows how DavCopy.exe reports information. The output indicates which files were not copied as well as the time and byte count for the each operation category (copied, skipped, mismatched, and deleted).
-------------------------------------------------------------------------------
BluedogLimited (TM) DavCopy
v1.2
Copyright (C) 2004-2006
BluedogLimited.com. All rights reserved.
-------------------------------------------------------------------------------
Started
: Sunday September 10, 2006 @ 11:20:52:9171
Source folder : .
File specification : *.htm
Destination folder : http://westgate:8090/test/
Timeout (min) :
2
Options
: /s /xf *docs\*c* w* /xd reports how-to
lang
-------------------------------------------------------------------------------
Folder
.
100%
8490 anlgform.html
Folder
docs
100%
10648 alias.html
100%
9699 args.html
100% 7262
debug.html
100%
7572 defns.html
100%
6651 dns.html
Skipped domfile.html
Skipped errors.html
100%
51756 faq.html
100%
24344 form.html
100%
1825
helpers.html
100%
8235 hierreps.html
100%
38966 indx.html
100%
18108 logfile.html
100%
18618 logfmt.html
100%
4099 lowmem.html
100%
8339 mailing.html
Mismatch
map.html
100%
1911 meaning.html
100%
18132 othreps.html
100%
23727 output.html
100%
3704 Readme.html
100%
15735 reports.html
Skipped startux.html
Skipped start.html
100%
7414 syntax.html
100%
7884 timereps.html
100%
26503 update.html
-------------------------------------------------------------------------------
Total Copied
Skipped
Mismatched
Deleted
Folders:
2
2
0
0
0
Files :
28
23
4
1
0
Bytes :
362482
329622
29486
3374
0
Time : 00:00:02.15 00:00:03.73 00:00:00.06 00:00:00.01 00:00:00.00
Ended : Sunday September 10, 2006 @ 11:20:55:0733
The return value is 5, where 4 files were skipped because they previously existed on the server and 1 mismatched file/folder combination was encountered.