line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::dropboxapi; |
2
|
1
|
|
|
1
|
|
50027
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
24
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
87
|
|
4
|
|
|
|
|
|
|
our $VERSION = '2.13'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
App::dropboxapi - command line interface to access Dropbox API |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 SYNOPSIS |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
dropbox-api put /tmp/foo.txt dropbox:/Public/ |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Run C<dropbox-api help> for more options. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
dropbox-api is a command line interface to access Dropbox API. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=over 4 |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=item ls |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=item find |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=item du |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=item sync |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=item cp |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=item mv |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=item rm |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=item mkdir |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=item get |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=item put |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=back |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 Install and Setup |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 1. Install |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head3 1-a) FreeBSD |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
pkg_add -r dropbox-api-command |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head3 1-b) Ubuntu |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sudo apt-get install make gcc libssl-dev wget |
55
|
|
|
|
|
|
|
wget https://raw.github.com/miyagawa/cpanminus/master/cpanm |
56
|
|
|
|
|
|
|
sudo perl cpanm App::dropboxapi |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head3 1-c) CentOS |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# CentOS 5 |
61
|
|
|
|
|
|
|
sudo yum install gcc gcc-c++ openssl-devel wget |
62
|
|
|
|
|
|
|
# CentOS 6 |
63
|
|
|
|
|
|
|
sudo yum install gcc gcc-c++ openssl-devel wget perl-devel |
64
|
|
|
|
|
|
|
wget https://raw.github.com/miyagawa/cpanminus/master/cpanm |
65
|
|
|
|
|
|
|
sudo perl cpanm App::dropboxapi |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head3 1-d) OS X |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# Install Command Line Tools for Xcode |
70
|
|
|
|
|
|
|
open https://www.google.com/search?q=Command+Line+Tools+for+Xcode |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
curl -O https://raw.github.com/miyagawa/cpanminus/master/cpanm |
73
|
|
|
|
|
|
|
sudo perl cpanm App::dropboxapi |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 2. Get API Key and API Secret |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
https://www.dropbox.com/developers |
78
|
|
|
|
|
|
|
My Apps => Create an App |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head2 3. Get Access Token and Access Secret |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
> dropbox-api setup |
83
|
|
|
|
|
|
|
Please Input API Key: *************** |
84
|
|
|
|
|
|
|
Please Input API Secret: *************** |
85
|
|
|
|
|
|
|
1. Open the Login URL: https://www.dropbox.com/oauth2/authorize?client_id=*****&response_type=code |
86
|
|
|
|
|
|
|
2. Input code and press Enter: *************** |
87
|
|
|
|
|
|
|
success! try |
88
|
|
|
|
|
|
|
> dropbox-api ls |
89
|
|
|
|
|
|
|
> dropbox-api find / |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 4. How to use Proxy |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Please use -e option. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
> HTTP_PROXY="http://127.0.0.1:8888" dropbox-api setup -e |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 Sub Commands |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head2 help |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
disp help. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=over 4 |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=item syntax |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
dropbox-api help [<command>] |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=back |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head3 Example |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
> dropbox-api help |
114
|
|
|
|
|
|
|
Usage: dropbox-api <command> [args] [options] |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Available commands: |
117
|
|
|
|
|
|
|
setup get access_key and access_secret |
118
|
|
|
|
|
|
|
ls list directory contents |
119
|
|
|
|
|
|
|
find walk a file hierarchy |
120
|
|
|
|
|
|
|
du disk usage statistics |
121
|
|
|
|
|
|
|
cp copy file or directory |
122
|
|
|
|
|
|
|
mv move file or directory |
123
|
|
|
|
|
|
|
mkdir make directory (Create intermediate directories as required) |
124
|
|
|
|
|
|
|
rm remove file or directory (Attempt to remove the file hierarchy rooted in each file argument) |
125
|
|
|
|
|
|
|
put upload file |
126
|
|
|
|
|
|
|
get download file |
127
|
|
|
|
|
|
|
sync sync directory (local => dropbox or dropbox => local) |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Common Options |
130
|
|
|
|
|
|
|
-e enable env_proxy ( HTTP_PROXY, NO_PROXY ) |
131
|
|
|
|
|
|
|
-D enable debug |
132
|
|
|
|
|
|
|
-v verbose |
133
|
|
|
|
|
|
|
-s sandbox mode, but this option has been removed. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
See 'dropbox-api help <command>' for more information on a specific command. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head3 Example ( command help ) |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
> dropbox-api help ls |
140
|
|
|
|
|
|
|
Name |
141
|
|
|
|
|
|
|
dropbox-api-ls - list directory contents |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
SYNOPSIS |
144
|
|
|
|
|
|
|
dropbox-api ls <dropbox_path> [options] |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Example |
147
|
|
|
|
|
|
|
dropbox-api ls Public |
148
|
|
|
|
|
|
|
dropbox-api ls Public -h |
149
|
|
|
|
|
|
|
dropbox-api ls Public -p "%d\t%s\t%TY/%Tm/%Td %TH:%TM:%TS\t%p\n" |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Options |
152
|
|
|
|
|
|
|
-h print sizes in human readable format (e.g., 1K 234M 2G) |
153
|
|
|
|
|
|
|
-p print format. |
154
|
|
|
|
|
|
|
%d ... is_dir ( d: dir, -: file ) |
155
|
|
|
|
|
|
|
%i ... id |
156
|
|
|
|
|
|
|
%n ... name |
157
|
|
|
|
|
|
|
%p ... path_display |
158
|
|
|
|
|
|
|
%P ... path_lower |
159
|
|
|
|
|
|
|
%b ... bytes |
160
|
|
|
|
|
|
|
%s ... size (e.g., 1K 234M 2G) |
161
|
|
|
|
|
|
|
%t ... server_modified |
162
|
|
|
|
|
|
|
%c ... client_modified |
163
|
|
|
|
|
|
|
%r ... rev |
164
|
|
|
|
|
|
|
%Tk ... DateTime 'strftime' function (server_modified) |
165
|
|
|
|
|
|
|
%Ck ... DateTime 'strftime' function (client_modified) |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
L<http://search.cpan.org/dist/DateTime/lib/DateTime.pm#strftime_Patterns> |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head2 ls |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
file list view. |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=over 4 |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item alias |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
list |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=item syntax |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
dropbox-api ls <dropbox_path> |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=back |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head3 Example |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
> dropbox-api list /product |
188
|
|
|
|
|
|
|
d - Thu, 24 Feb 2011 06:58:00 +0000 /product/chrome-extentions |
189
|
|
|
|
|
|
|
- 294557 Sun, 26 Dec 2010 21:55:59 +0000 /product/ex.zip |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=head3 human readable option ( -h ) |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
print sizes in human readable format (e.g., 1K 234M 2G) |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
> dropbox-api ls /product -h |
196
|
|
|
|
|
|
|
d - Thu, 24 Feb 2011 06:58:00 +0000 /product/chrome-extentions |
197
|
|
|
|
|
|
|
- 287.7KB Sun, 26 Dec 2010 21:55:59 +0000 /product/ex.zip |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=head3 printf option ( -p ) |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
print format. |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
> dropbox-api ls /product -p "%d\t%s\t%TY/%Tm/%Td %TH:%TM:%TS\t%p\n" |
204
|
|
|
|
|
|
|
d - 2011/02/24 06:58:00 /product/chrome-extentions |
205
|
|
|
|
|
|
|
- 287.7KB 2010/12/26 21:55:59 /product/ex.zip |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
%d ... is_dir ( d: dir, -: file ) |
208
|
|
|
|
|
|
|
%i ... id |
209
|
|
|
|
|
|
|
%n ... name |
210
|
|
|
|
|
|
|
%p ... path_display |
211
|
|
|
|
|
|
|
%P ... path_lower |
212
|
|
|
|
|
|
|
%b ... bytes |
213
|
|
|
|
|
|
|
%s ... size (e.g., 1K 234M 2G) |
214
|
|
|
|
|
|
|
%t ... server_modified |
215
|
|
|
|
|
|
|
%c ... client_modified |
216
|
|
|
|
|
|
|
%r ... rev |
217
|
|
|
|
|
|
|
%Tk ... DateTime 'strftime' function (server_modified) |
218
|
|
|
|
|
|
|
%Ck ... DateTime 'strftime' function (client_modified) |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
L<http://search.cpan.org/dist/DateTime/lib/DateTime.pm#strftime_Patterns> |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=head2 find |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
recursive file list view. |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=over 4 |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=item syntax |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
dropbox-api find <dropbox_path> [options] |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=back |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=head3 Example |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
> dropbox-api find /product/google-tasks-checker-plus |
237
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/README.md |
238
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src |
239
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src/background.html |
240
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src/external.png |
241
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src/icon-32.png |
242
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src/icon-128.png |
243
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src/icon.gif |
244
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src/jquery-1.4.2.min.js |
245
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src/main.js |
246
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src/manifest.json |
247
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src/options.html |
248
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src/popup.html |
249
|
|
|
|
|
|
|
/product/chrome-extentions/google-tasks-checker-plus/src/reset.css |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=head3 printf option ( -p ) |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
see also list command's printf option. |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
=head2 du |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
display disk usage statistics. |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=over 4 |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
=item syntax |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
dropbox-api du <dropbox_path> [options] |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=back |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
=head3 Example |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
> dropbox-api du /product -h -d 1 |
270
|
|
|
|
|
|
|
1.1M /product |
271
|
|
|
|
|
|
|
1.1M /product/chrome-extensions |
272
|
|
|
|
|
|
|
0B /product/work |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
=head3 human readable option ( -h ) |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
print sizes in human readable format (e.g., 1K 234M 2G) |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
=head3 depth option ( -d ) |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
Display an entry for all files and directories depth directories deep. |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
=head2 sync ( rsync ) |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
recursive file synchronization. |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=head3 sync from dropbox |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
dropbox-api sync dropbox:<source_dir> <target_dir> [options] |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
> dropbox-api sync dropbox:/product/google-tasks-checker-plus/src /tmp/product |
291
|
|
|
|
|
|
|
download /private/tmp/product/external.png |
292
|
|
|
|
|
|
|
download /private/tmp/product/icon-32.png |
293
|
|
|
|
|
|
|
download /private/tmp/product/icon-128.png |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
=head3 sync to dropbox |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
dropbox-api sync <source_dir> dropbox:<target_dir> [options] |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
> dropbox-api sync /tmp/product dropbox:/work/src |
300
|
|
|
|
|
|
|
upload background.html /work/src/background.html |
301
|
|
|
|
|
|
|
upload external.png /work/src/external.png |
302
|
|
|
|
|
|
|
upload icon-128.png /work/src/icon-128.png |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
=head3 delete option ( -d ) |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
> dropbox-api sync dropbox:/product/google-tasks-checker-plus/src /tmp/product -d |
307
|
|
|
|
|
|
|
download /private/tmp/product/external.png |
308
|
|
|
|
|
|
|
download /private/tmp/product/icon-32.png |
309
|
|
|
|
|
|
|
download /private/tmp/product/icon-128.png |
310
|
|
|
|
|
|
|
remove background.html.tmp |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
=head3 dry run option ( -n ) |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
> dropbox-api sync dropbox:/product/google-tasks-checker-plus/src /tmp/product -dn |
315
|
|
|
|
|
|
|
!! enable dry run !! |
316
|
|
|
|
|
|
|
download /private/tmp/product/external.png |
317
|
|
|
|
|
|
|
download /private/tmp/product/icon-32.png |
318
|
|
|
|
|
|
|
download /private/tmp/product/icon-128.png |
319
|
|
|
|
|
|
|
remove background.html.tmp |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
=head3 verbose option ( -v ) |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
> dropbox-api sync dropbox:/product/google-tasks-checker-plus/src /tmp/product -dnv |
324
|
|
|
|
|
|
|
remote_base: /product/chrome-extentions/google-tasks-checker-plus/src |
325
|
|
|
|
|
|
|
local_base: /private/tmp/product |
326
|
|
|
|
|
|
|
** download ** |
327
|
|
|
|
|
|
|
skip background.html |
328
|
|
|
|
|
|
|
download /private/tmp/product/external.png |
329
|
|
|
|
|
|
|
download /private/tmp/product/icon-32.png |
330
|
|
|
|
|
|
|
download /private/tmp/product/icon-128.png |
331
|
|
|
|
|
|
|
skip icon.gif |
332
|
|
|
|
|
|
|
skip jquery-1.4.2.min.js |
333
|
|
|
|
|
|
|
skip main.js |
334
|
|
|
|
|
|
|
skip manifest.json |
335
|
|
|
|
|
|
|
skip options.html |
336
|
|
|
|
|
|
|
skip popup.html |
337
|
|
|
|
|
|
|
skip reset.css |
338
|
|
|
|
|
|
|
** delete ** |
339
|
|
|
|
|
|
|
skip background.html |
340
|
|
|
|
|
|
|
remove background.html.tmp |
341
|
|
|
|
|
|
|
skip icon.gif |
342
|
|
|
|
|
|
|
skip jquery-1.4.2.min.js |
343
|
|
|
|
|
|
|
skip main.js |
344
|
|
|
|
|
|
|
skip manifest.json |
345
|
|
|
|
|
|
|
skip options.html |
346
|
|
|
|
|
|
|
skip popup.html |
347
|
|
|
|
|
|
|
skip reset.css |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
=head2 cp |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
copy file or directory. |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
=over 4 |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
=item alias |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
copy |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
=item syntax |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
dropbox-api cp <source_file> <target_file> |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=back |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
=head3 Example |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
dropbox-api cp memo.txt memo.txt.bak |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
=head2 mv |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
move file or directory. |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
=over 4 |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
=item alias |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
move |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
=item syntax |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
dropbox-api mv <source_file> <target_file> |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
=back |
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
=head3 Example |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
dropbox-api mv memo.txt memo.txt.bak |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
=head2 mkdir |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
make directory. |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
*no error if existing, make parent directories as needed.* |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=over 4 |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
=item alias |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
mkpath |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
=item syntax |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
dropbox-api mkdir <directory> |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
=back |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
=head3 Example |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
dropbox-api mkdir product/src |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
=head2 rm |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
remove file or directory. |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
*remove the contents of directories recursively.* |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
=over 4 |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
=item alias |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
rmtree |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
=item syntax |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
dropbox-api rm <file_or_directory> |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
=back |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
=head3 Example |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
dropbox-api rm product/src |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=head2 get |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
download file from dropbox. |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
=over 4 |
438
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
=item alias |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
dl, download |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
=item syntax |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
dropbox-api get dropbox:<dropbox_file> <file> |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
=back |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
=head3 Example |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
dropbox-api get dropbox:/Public/foo.txt /tmp/foo.txt |
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
=head2 put |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
upload file to dropbox. |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
=over 4 |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
=item alias |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
up, upload |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
=item syntax |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
dropbox-api put <file> dropbox:<dropbox_dir> |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
=back |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
=head3 Example |
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
dropbox-api put /tmp/foo.txt dropbox:/Public/ |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
=head3 verbose option ( -v ) |
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
A progress bar is displayed. |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
dropbox-api put /tmp/1GB.dat dropbox:/Public/ -v |
478
|
|
|
|
|
|
|
100% [=====================================================================================>] |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
=head2 Tips |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
=head3 Retry |
483
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
#!/bin/bash |
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
command='dropbox-api sync dropbox:/test/ /Users/aska/test/ -vde' |
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
NEXT_WAIT_TIME=0 |
489
|
|
|
|
|
|
|
EXIT_CODE=0 |
490
|
|
|
|
|
|
|
until $command || [ $NEXT_WAIT_TIME -eq 4 ]; do |
491
|
|
|
|
|
|
|
EXIT_CODE=$? |
492
|
|
|
|
|
|
|
sleep $NEXT_WAIT_TIME |
493
|
|
|
|
|
|
|
let NEXT_WAIT_TIME=NEXT_WAIT_TIME+1 |
494
|
|
|
|
|
|
|
done |
495
|
|
|
|
|
|
|
exit $EXIT_CODE |
496
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
=head1 COPYRIGHT |
498
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
Copyright 2012- Shinichiro Aska |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
The standalone executable contains the following modules embedded. |
502
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
=head1 LICENSE |
504
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
Released under the MIT license. http://creativecommons.org/licenses/MIT/ |
506
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
=head1 COMMUNITY |
508
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
=over 4 |
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
=item L<https://github.com/s-aska/dropbox-api-command> - source code repository, issue tracker |
512
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
=back |
514
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
=cut |
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
1; |