/
mod_copy.html
185 lines (156 loc) · 4.88 KB
/
mod_copy.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<html>
<head>
<title>ProFTPD module mod_copy</title>
</head>
<body bgcolor=white>
<hr>
<center>
<h2><b>ProFTPD module <code>mod_copy</code></b></h2>
</center>
<hr><br>
<p>
The <code>mod_copy</code> module implements <code>SITE CPFR</code>
and <code>SITE CPTO</code> commands (analogous to <code>RNFR</code> and
<code>RNTO</code>), which can be used to copy files/directories from one place
to another on the server without having to transfer the data to the client and
back.
<p>
This module is contained in the <code>mod_copy.c</code> file for
ProFTPD 1.3.<i>x</i>, and is not compiled by default. Installation
instructions are discussed <a href="#Installation">here</a>.
<p>
The most current version of <code>mod_copy</code> is distributed with the
ProFTPD source code.
<h2>Author</h2>
<p>
Please contact TJ Saunders <tj <i>at</i> castaglia.org> with any
questions, concerns, or suggestions regarding this module.
<h2>Directives</h2>
<ul>
<li><a href="#CopyEngine">CopyEngine</a>
<li><a href="#CopyOptions">CopyOptions</a>
</ul>
<h2><code>SITE</code> Commands</h2>
<ul>
<li><a href="#SITE_CPFR">SITE CPFR</a>
<li><a href="#SITE_CPTO">SITE CPTO</a>
</ul>
<p>
<hr>
<h2><a name="CopyEngine">CopyEngine</a></h2>
<strong>Syntax:</strong> CopyEngine <em>on|off</em><br>
<strong>Default:</strong> CopyEngine on<br>
<strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br>
<strong>Module:</strong> mod_copy<br>
<strong>Compatibility:</strong> 1.3.6rc1 and later
<p>
The <code>CopyEngine</code> directive enables or disables the module's
handling of <code>SITE COPY</code> <i>et al</i> commands. If it is set to
<em>off</em> this module ignores these commands.
<p>
<hr>
<h2><a name="CopyOptions">CopyOptions</a></h2>
<strong>Syntax:</strong> CopyOptions <em>opt1 ...</em><br>
<strong>Default:</strong> None<br>
<strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br>
<strong>Module:</strong> mod_copy<br>
<strong>Compatibility:</strong> 1.3.6rc3 and later
<p>
The <code>CopyOptions</code> directive is used to configure various optional
behavior of <code>mod_copy</code>.
<p>
The currently implemented options are:
<ul>
<li><code>NoDeleteOnFailure</code><br>
<p>
The <code>mod_copy</code> file, when a copying operation fails, will
delete the <i>destination</i> file by default. If, however, you <b>do</b>
want to keep that destination file when a failure happens, use this option.
</li>
</ul>
<p>
<hr>
<h2><a name="SITE_CPFR">SITE CPFR</a></h2>
This <code>SITE</code> command specifies the source file/directory to use
for copying from one place to another directly on the server.
<p>
The syntax for <code>SITE CPFR</code> is:
<pre>
SITE CPFR <i>source-path</i>
</pre>
<p>
See also: <a href="#SITE_CPTO">SITE CPTO</a>
<hr>
<h2><a name="SITE_CPTO">SITE CPTO</a></h2>
This <code>SITE</code> command specifies the destination file/directory to use
for copying from one place to another directly on the server.
<p>
The syntax for <code>SITE CPTO</code> is:
<pre>
SITE CPTO <i>destination-path</i>
</pre>
<p>
A client wishing to copy a file/directory first sends a <code>SITE CPFR</code>
command, then a <code>SITE CPTO</code>; this is similar to how renames are
handled using <code>RNFR</code> and <code>RNTO</code>.
<p>
Use of these <code>SITE</code> command can be controlled via
<code><Limit><code> sections, <i>e.g.</i>:
<pre>
<Limit SITE_COPY>
AllowUser alex
DenyAll
</Limit>
</pre>
<p>
See also: <a href="#SITE_CPFR">SITE CPFR</a>
<p>
<b>Logging</b><br>
The <code>mod_copy</code> module supports <a href="../howto/Tracing.html">trace logging</a>, via the module-specific log channels:
<ul>
<li>copy
</ul>
Thus for trace logging, to aid in debugging, you would use the following in
your <code>proftpd.conf</code>:
<pre>
TraceLog /path/to/ftpd/trace.log
Trace copy:20
</pre>
This trace logging can generate large files; it is intended for debugging use
only, and should be removed from any production configuration.
<hr>
<h2><a name="Installation">Installation</a></h2>
To install <code>mod_copy</code>, copy the <code>mod_copy.c</code> file into:
<pre>
<i>proftpd-dir</i>/contrib/
</pre>
after unpacking the latest proftpd-1.3.<i>x</i> source code. For including
<code>mod_copy</code> as a staticly linked module:
<pre>
$ ./configure --with-modules=mod_copy
</pre>
To build <code>mod_copy</code> as a DSO module:
<pre>
$ ./configure --enable-dso --with-shared=mod_copy
</pre>
Then follow the usual steps:
<pre>
$ make
$ make install
</pre>
<p>
For those with an existing ProFTPD installation, you can use the
<code>prxs</code> tool to add <code>mod_copy</code>, as a DSO module, to
your existing server:
<pre>
$ prxs -c -i -d mod_copy.c
</pre>
<p>
<hr><br>
<font size=2><b><i>
© Copyright 2009-2016 TJ Saunders<br>
All Rights Reserved<br>
</i></b></font>
<hr><br>
</body>
</html>