SYNOPSIS

dave [\s-1OPTIONS\s0] \s-1URL\s0

E.g.

   $ dave -u pcollins -p mypass www.host.org/dav_dir/
   ...
   dave> get file.txt

Use \*(L"dave -h\*(R" to get help on options

Use \*(L"perldoc dave\*(R" for the whole manpage.

DESCRIPTION

dave is a powerful command-line program for interacting with WebDAV-enabled webservers. With dave you can:

  • get and put files

  • make directories on a remote webserver

  • remove files and directories from a remote webserver

  • edit a file on the webserver with a single command

  • recursively get a remote directory

  • recursively put a local directory

  • lock and unlock remote files and directories

  • securely transfer over https

  • authenticate using the safer Digest authentication

Dave is a part of the PerlDAV project (http://www.webdav.org/perldav/) and is built on top of the \s-1HTTP::DAV\s0 perl \s-1API\s0.

If you would like to script webdav interactions in Perl checkout the \s-1HTTP::DAV\s0 \s-1API\s0 as it's commands are the basis for dave's.

OPTIONS

-debug N

Sets the debug level to N. 0=none. 3=noisy.

-h

Prints basic help and options.

-man

Prints the full manual (equivalent to perldoc dave). You will need to use a pager like \*(L"more\*(R" or \*(L"less\*(R". e.g. dave -man |less

-p <password>

Sets the password to be used for the \s-1URL\s0. You must also supply a user. See -u.

-u <username>

Sets the username to be used for the \s-1URL\s0. You must also supply a pass. See -p.

COMMANDS

cd \s-1URL\s0

changes directories dave> open host.org/dav_dir/ dave> cd dir1 dave> cd ../dir2

cat \s-1URL\s0

shows the contents of a remote file dave> open host.org/dav_dir/ dave> cat index.html Note: you cannot cat a directory (collection).

cp
copy \s-1SOURCE_URL\s0 \s-1DEST_URL\s0

copies one remote resource to another dave> open host.org/dav_dir/ Create a copy of dir1/ as dav2/ dave> cp dir1 dav2 Create a copy of dir1/file.txt as dav2/file.txt dave> cd dir1 dave> copy file.txt ../dav2 Create a copy of file.txt as ../dav2/new_file.txt dave> copy file.txt dav2/new_file.txt Aliases: cp

rmdir \s-1URL\s0
rm \s-1URL\s0
delete \s-1URL\s0

deletes a remote resource dave> open host.org/dav_dir/ dave> delete index.html dave> rmdir ./dir1 dave> delete /dav_dir/dir2/ dave> delete /dav_dir/*.html This command recursively deletes directories. \s-1BE\s0 \s-1CAREFUL\s0 :) This command supported wildcards (globbing). See get. Aliases: rm, rmdir

edit \s-1URL\s0

edits the contents of a remote file dave> open host.org/dav_dir/ dave> edit index.html Edit is equivalent to the following sequence of commands: LOCK index.html (if allowed) GET index.html /tmp/dave.perldav.421341234124 sh $EDITOR /tmp/dave.perldav.421341234124 PUT index.html (if modified) UNLOCK index.html (if locked) Where $EDITOR is determined from the environment variables \s-1DAV_EDITOR\s0 or \s-1EDITOR\s0. If \s-1DAV_EDITOR\s0 is set, it will use that, otherwise it will use \s-1EDITOR\s0. If neither variables are set, then \*(L"vi\*(R" will be used. Notes: The lock only lasts for 10 hours. You cannot edit a directory (collection). The temporary save directory is editable by editing dave and changing \s-1TMP_DIR\s0

get \s-1URL\s0 [\s-1FILE\s0]

downloads the file or directory at \s-1URL\s0 If \s-1FILE\s0 is not specified it will be saved to your current working directory using the same name as the remote name. dave> open host.org/dav_dir/ Recursively get remote my_dir/ to . dave> get my_dir/ Recursively get remote my_dir/ to /tmp/my_dir/ dave> get my_dir /tmp Get remote my_dir/index.html to /tmp/index.html dave> get /dav_dir/my_dir/index.html /tmp Get remote index.html to /tmp/index1.html dave> get index.html /tmp/index1.html Use globs and save to /tmp dave> get index* /tmp # Gets index*.html, index*.txt, etc. dave> get index*.html /tmp/index1.html # Gets index*.html dave> get index[12].htm? # Gets file1 and file2, .htm and .html

? [\s-1CMD\s0]
h [\s-1CMD\s0]
help [\s-1CMD\s0]

prints list of commands or help for \s-1CMD\s0 dave> ?

dave> help get Aliases: ?, h

lcd [\s-1DIR\s0]

changes local directory dave> lcd /tmp

lls [\s-1DIR\s0]

lists local directory contents dave> lcd /tmp dave> lls dave> lls /home This command simply execs the local ls command and is equivalent to \*(L"!ls\*(R"

dir [\s-1URL\s0]
ls [\s-1URL\s0]

lists remote directory contents or file props dave> ls Listing of http://host.org/dav_dir/ ./ Aug 29 02:26 <dir> mtx_0.04.tar.gz 52640 Aug 11 11:45 index.html 4580 Aug 11 11:45 index0.04.html 4936 Nov 11 2000 mydir/ Aug 19 21:14 <dir>,<locked>

dave> ls index.html URL: http://www.webdav.org/perldav/index.html Content-type: text/html Creation date: Sun Aug 12 21:58:02 2001 Last modified: Size: 4580 bytes Locks supported: write/exclusive write/shared Locks: Use propfind to get a similar printout of a collection (directory). Aliases: dir

lock [\s-1URL\s0 [\s-1TIMEOUT\s0] [\s-1DEPTH\s0]]

locks a resource Without a \s-1URL\s0 you will lock the current remote collection. \s-1TIMEOUT\s0 can be any of the following formats:

             30s          30 seconds from now
             10m          ten minutes from now
             1h           one hour from now
             1d           tomorrow
             3M           in three months
             10y          in ten years time
             2000-02-31 00:40:33
             2000-02-31

Default is an infinite timeout See perldoc \*(C`HTTP::DAV::Resource\*(C' for more information about timeouts. \s-1DEPTH\s0 can be either \*(L"0\*(R" or \*(L"infinity\*(R" (default) Seeting the lock Scope and Type is not currently implemented. Let me know if you need it as it shouldn't be too much effort.

mkdir \s-1URL\s0
mkcol \s-1URL\s0

make a remote collection (directory) dave> open host.org/dav_dir/ dave> mkcol new_dir dave> mkdir /dav_dir/new_dir Aliases: mkdir

mv
move \s-1SOURCE_URL\s0 \s-1DEST_URL\s0

moves a remote resource to another dave> open host.org/dav_dir/ Move dir1/ to dav2/ dave> move dir1 dav2 Move file dir2/file.txt to ../file.txt dave> cd dir2 dave> move file.txt .. Move file.txt to dav2/new_file.txt dave> move file.txt dav2/new_file.txt Aliases: mv

open \s-1URL\s0

connects to the WebDAV-enabled server at \s-1URL\s0 dave> open host.org/dav_dir/ Note that if authorization details are required you will be prompted for them. https and Digest authorization are not currently supported. Please let me know if you need it.

options [\s-1URL\s0]

show the \s-1HTTP\s0 methods allowed for a \s-1URL\s0 dave> options index.html OPTIONS, GET, HEAD, POST, DELETE, TRACE, PROPFIND, PROPPATCH, COPY, MOVE, LOCK, UNLOCK Note that Microsoft's \s-1IIS\s0 does not support \s-1LOCK\s0 on collections (directories). Nor does it support \s-1PROPPATCH\s0.

propfind [\s-1URL\s0]

show the properties of a resource dave> propfind test URL: http://host.org/dav_dir/test/ Content-type: httpd/unix-directory Creation date: Wed Aug 29 00:36:42 2001 Last modified: Size: bytes Locks supported: write/exclusive write/shared Locks: Using ls will get you the same printout if you ls a file. But ls'ing a collection will show you the collections contents.

put \s-1FILE\s0 [\s-1URL\s0]

uploads a local file or directory to \s-1URL\s0 or the currently opened location. If \s-1URL\s0 is an existing collection then the dir/file will be copied \s-1INTO\s0 that collection. dave> open host.org/dav_dir/ Recursively put local my_dir/ to host.org/dav_dir/my_dir/: dave> put my_dir/ Put local index.html to host.org/dav_dir/index1.html: dave> put /tmp/index.html index1.html Put * to remote directory dave> put * Put index[12].htm? to remote directory /dav_dir (/dav_dir must exist) dave> put index[12].htm? /dav_dir Put index[1234].htm? to remote directory /dav_dir (/dav_dir must exist) dave> put index[1-4].htm? /dav_dir Glob types supported are, * (matches any characters), ? (matches any one character), [...] (matches any characters in the set ...).

pwd

prints the currently opened \s-1URL\s0 (working directory) dave> open host.org/dav_dir/ dave> cd new_dir/ dave> pwd http://host.org/dav_dir/new_dir/

q
bye
quit

exits dave Note that dave does not unlock any locks created during your session. Aliases: q, quit

set \s-1URL\s0 \s-1PROPERTY\s0 \s-1VALUE\s0 [\s-1NAMESPACE\s0]

sets a custom property on a resource dave> set file.txt author "Patrick Collins" dave> set file.txt author "Patrick Collins" "mynamespace" The \s-1NAMESPACE\s0 by default is \*(L"\s-1DAV:\s0\*(R".

!
sh

executes a local command (alias !) dave> sh cat localfile dave> !gzip localfile.gz dave> ! "cat localfile | less" Aliases: !

showlocks

show my locks on a resource Shows any locked resources that you've locked in this session. See \*(C`propfind\*(C' if you'd like to see anyone's locks held against a particular resource.

steal [\s-1URL\s0]

remove \s-1ANY\s0 locks on a resource Useful if you accidentally forgot to unlock a resource from a previous session or if you think that somebody has forgotten to unlock a resource.

unlock [\s-1URL\s0]

unlocks a resource Note that unlock will only unlock locks that you have created. Use steal if you want to forcefully unlock somebody else's lock.

unset \s-1URL\s0 \s-1PROPERTY\s0 [\s-1NAMESPACE\s0]

unsets a property from a resource dave> unset file.txt author dave> unset file.txt author "mynamespace" The \s-1NAMESPACE\s0 by default is \*(L"\s-1DAV:\s0\*(R".

GETTING HELP

The perldav mailing list There is a mailing list for PerlDAV and dave for use by Developers and Users. Please see http://mailman.webdav.org/mailman/listinfo/perldav

INSTALLATION

dave is installed to /usr/local/bin by default when you install the PerlDAV library. See http://www.webdav.org/perldav/ for installation details of PerlDAV.

WHAT PLATFORMS WILL IT WORK ON?

dave is pure perl so only needs Perl5.003 (or later) and the \*(C`PerlDAV\*(C' library to be installed.

I have not ported dave to Windows but would like somebody to have a shot at it.

RELATED TO dave…

The \*(C`PerlDAV\*(C' perl \s-1API\s0 at http://www.webdav.org/perldav/ or by typing \*(L"perldoc \s-1HTTP::DAV\s0\*(R" on your command line.

AUTHOR AND COPYRIGHT

This module is Copyright (C) 2001 by

Patrick Collins G03 Gloucester Place, Kensington Sydney, Australia

Email: [email protected] Phone: +61 2 9663 4916

All rights reserved.

You may distribute this module under the terms of either the \s-1GNU\s0 General Public License or the Artistic License, as specified in the Perl \s-1README\s0 file.