4 The operations of uploading files to pithos as objects, and downloading
5 objects from pithos as a file are presented in this section.
9 .. code-block:: console
15 Upload a file or a directory
16 ----------------------------
18 First, check the files at the current directory
20 .. code-block:: console
26 pithos (36MB, 5 objects)
29 .. note:: the `!` symbol is used to run host shell commands
31 Upload `file2upload.txt` to remote container `pithos`
33 .. code-block:: console
35 [file]: upload file2upload.txt pithos
36 Uploading /home/someuser/file2upload.txt --> pithos:file2upload.txt
39 Check remote container `pithos` to confirm
41 .. code-block:: console
52 Attempt to upload a whole directory, fail and retry with correct arguments
54 .. code-block:: console
56 [file]: upload dir2upload pithos
57 /home/someuser/dir2upload is a directory
58 | Use -R to upload directory contents
59 [file]: upload -R dirupload pithos
60 mkdir pithos:dir2upload
61 Uploading /home/someuser/dir2upload/large.mov --> pithos:dir2upload/large.mov
62 Uploading /home/someuser/dir2upload/small.mov --> pithos:dir2upload/small.mov
66 1GB dir2upload/large.mov
67 1MB dir2upload/small.mov
76 .. note:: Try to reupload the files (use the -f option to override) and notice
77 how much faster is the uploading now. Pithos can determine what parts of
78 the file are already uploaded so that kamaki won't attempt to upload them
81 Download an object or a directory
82 ---------------------------------
84 Download object `info.txt` as a local file of the same name
86 .. code-block:: console
88 [file]: download pithos:info.txt
89 Downloading pithos:info.txt --> /home/someuser/info.txt
93 Download directory `video` as a local directory with its contents.
94 We will suppose that a power failure causes the operation to stop unexpectingly
95 before it's completed.
97 .. code-block:: console
99 [file]: download -R pithos:video
101 Downloading pithos:video/tk1.mpg --> /home/someuser/video/tk1.mpg
103 Downloading pithos:video/tk2.mpg --> /home/someuser/video/tk2.mpg
106 After we recover the terminal and load kamaki in `file` context, we find out
107 that `tk1.mpg` had been downloaded while `tk2.mpg` download is incomplete.
109 .. code-block:: console
116 Let's resume the download uperations (use -r)
118 .. code-block:: console
120 [file]: download -R pithos:video
121 Directory video already exists
123 [file]: download -R -r pithos:video
124 Resuming pithos:video/tk2.mpg --> /home/someuser/video/tk2.mpg
125 Downloading pithos:video/tk3.mpg --> /home/someuser/video/tk3.mpg
132 .. code-block:: console
134 [file]: upload -R -f . pithos
138 .. note:: Kamaki calculated that all information is already uploaded, there was
139 nothing to be done. If there is was a new or modified file, kamaki would
140 detect and upload it.
145 .. code-block:: console
147 [file]: download -R -r pithos
151 .. note:: Kamaki determined that all files have already been calculated. This
152 operation examines all local files against the remote objects and
153 downloads only missing data.
158 .. code-block:: console