![]() ![]() In this run we’ll first check with -dry-run to see what would be uploaded. Now modify for instance dir1/file1-2.txt and see what happens. ![]() s3://s3tools-demo/some/path/ĭir2/file2-1.log -> s3://s3tools-demo/some/path/dir2/file2-1.log ĭir2/file2-2.txt -> s3://s3tools-demo/some/path/dir2/file2-2.txt Īs you can see only the files that we haven’t uploaded yet, that is those from dir2, were now sync‘ed. If you ran all the above examples you’ll get a similar output to the following one from a sync: However the important difference is that sync first checks the list and details of the files already present at the destination, compares with the local files and only uploads the ones that either are not present remotely or have a different size or md5 checksum. A bit more powerful is sync – the path names handling is the same as was just explained. The above examples were built around put command. I hope it’s clear enough, if not ask in the mailing list or send me a better wording -) So the final S3 paths are s3://s3…/path/file1-1.txt and s3://s3…/path/file1-2.txt respectively, both without the dir1/ member in them. ![]() In that case the last part(s) of the path name are the filenames ( file1-1.txt and file1-2.txt) without the dir1/ directory name. On the other hand in the case of dir1/ (note the trailing slash), which would be the same as ~/demo/dir1/ (trailing slash again) is actually similar to saying dir1/* – ie expand to the list of the files in dir1. In the case of dir1 without trailing slash (which would be the same as, say, ~/demo/dir1 in our case) the last part of the path is dir1 and that’s what’s used on the remote side, appended after s3://s3…/path/ to make s3://s3…/path/dir1/…. Important - in both cases just the last part of the path name is taken into account. ![]() On the other hand to upload just the contents, specify the directory it with a trailing slash: To upload a directory and keep its name on the remote side specify the source without the trailing slash: It all depends on how you specify the source. With directories there is one thing to watch out for – you can either upload the directory and its contents or just the contents. We can also upload a directory with -recursive parameter: ~/demo$ s3cmd put file0-1.msg s3://s3tools-demo/test-upload.msgįile0-1.msg -> s3://s3tools-demo/test-upload.msg Obviously we can for instance upload one of the files to S3 and give it a different name: Let’s have these files in our working directory: The source can be a single file or a directory and there could be multiple sources used in one command. Sync, get and put all support multiple arguments for source files and one argument for destination file or directory (optional in some case of get). This is similar to a unix rsync command, with some exceptions outlined below.įilenames handling rules and some other options are common for both these methods. By default a md5 checksum and file size is compared.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |