Author: Chou-han Yang (@chouhanyang)
Current Maintainers: Naveen Vardhi (@rozuur) | Navin Pai (@navinpai)
--API-ServerSideEncryption along with 36 new API pass-through options. See API pass-through options section for complete list.S4CMD_OPTS environment variable for commonly used options such as --API-ServerSideEncryption across all your s4cmd operations.--last-modified-before and --last-modified-after options for all operations. Human friendly timestamps are supported, e.g. --last-modified-before='2 months ago'dsync command is better and standalone implementation to replace old sync command, which is implemented based on top of get/put/mv commands. --delete-removed work for all cases including local to s3, s3 to local, and s3 to s3. sync command preserves the old behavior in this version for compatibility.S4cmd is a command-line utility for accessing Amazon S3, inspired by s3cmd.
We have used s3cmd heavily for a number of scripted, data-intensive applications. However as the need for a variety of small improvements arose, we created our own implementation, s4cmd. It is intended as an alternative to s3cmd for enhanced performance and for large files, and with a number of additional features and fixes that we have found useful.
It strives to be compatible with the most common usage scenarios for s3cmd. It does not offer exact drop-in compatibility, due to a number of corner cases where different behavior seems preferable, or for bugfixes.
S4cmd supports the regular commands you might expect for fetching and storing
files in S3: ls, put, get, cp, mv, sync, del, du.
The main features that distinguish s4cmd are:
s3:// and s3n:// prefixes (the latter is common with
Amazon Elastic Mapreduce).Limitations:
sync with get and put with --recursive --force --sync-check.You can install s4cmd PyPI.
pip install s4cmd
s4cmd.py as s4cmd. (It is just
a single file!)~/.s3cfg file from configuring s3cmd, credentials
from this file will be used. Otherwise, set the S3_ACCESS_KEY and
S3_SECRET_KEY environment variables to contain your S3 credentials.s4cmd ls [path]List all contents of a directory.
s4cmd put [source] [target]Upload local files up to S3.
s4cmd get [source] [target]Download files from S3 to local filesystem.
s4cmd dsync [source dir] [target dir]Synchronize the contents of two directories. The directory can either be local or remote, but currently, it doesn't support two local directories.
s4cmd sync [source] [target](Obsolete, use dsync instead) Synchronize the contents of two directories. The directory can either be local or remote, but currently, it doesn't support two local directories. This command simply invoke get/put/mv commands.
s4cmd cp [source] [target]Copy a file or a directory from a S3 location to another.
s4cmd mv [source] [target]Move a file or a directory from a S3 location to another.
s4cmd del [path]Delete files or directories on S3.
s4cmd du [path]Get the size of the given directory.
Available parameters:
-p S3CFG, --config=[filename]path to s3cfg config file
-f, --forceforce overwrite files when download or upload
-r, --recursiverecursively checking subdirectories
-s, --sync-checkcheck file md5 before download or upload
-n, --dry-runtrial run without actual download or upload
-t RETRY, --retry=[integer]number of retries before giving up
--retry-delay=[integer]seconds to sleep between retries
-c NUM_THREADS, --num-threads=NUM_THREADSnumber of concurrent threads
--endpoint-urlendpoint url used in boto3 client
-d, --show-directoryshow directory instead of its content
--ignore-empty-sourceignore empty source from s3
--use-ssl(obsolete) use SSL connection to S3
--verboseverbose output
--debugdebug output
--validate(obsolete) validate lookup operation
-D, --delete-removeddelete remote files that do not exist in source after sync
--multipart-split-size=[integer]size in bytes to split multipart transfers
--max-singlepart-download-size=[integer]files with size (in bytes) greater than this will be downloaded in multipart transfers
--max-singlepart-upload-size=[integer]files with size (in bytes) greater than this will be uploaded in multipart transfers
--max-singlepart-copy-size=[integer]files with size (in bytes) greater than this will be copied in multipart transfers
--batch-delete-size=[integer]Number of files (<1000) to be combined in batch delete.
--last-modified-before=[datetime]Condition on files where their last modified dates are before given parameter.
--last-modified-after=[datetime]Condition on files where their last modified dates are after given parameter.
Those options are directly translated to boto3 API commands. The options provided will be filtered by the APIs that are taking parameters. For example, --API-ServerSideEncryption is only needed for put_object, create_multipart_upload but not for list_buckets and get_objects for example. Therefore, providing --API-ServerSideEncryption for s4cmd ls has no effect.
For more information, please see boto3 s3 documentations http://boto3.readthedocs.io/en/latest/reference/services/s3.html
--API-ACL=[string]The canned ACL to apply to the object.
--API-CacheControl=[string]Specifies caching behavior along the request/reply chain.
--API-ContentDisposition=[string]Specifies presentational information for the object.
--API-ContentEncoding=[string]Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
--API-ContentLanguage=[string]The language the content is in.
--API-ContentMD5=[string]The base64-encoded 128-bit MD5 digest of the part data.
--API-ContentType=[string]A standard MIME type describing the format of the object data.
--API-CopySourceIfMatch=[string]Copies the object if its entity tag (ETag) matches the specified tag.
--API-CopySourceIfModifiedSince=[datetime]Copies the object if it has been modified since the specified time.
--API-CopySourceIfNoneMatch=[string]Copies the object if its entity tag (ETag) is different than the specified ETag.
--API-CopySourceIfUnmodifiedSince=[datetime]Copies the object if it hasn't been modified since the specified time.
--API-CopySourceRange=[string]The range of bytes to copy from the source object. The range value must use the form bytes=first-last, where the first and last are the zero-based byte offsets to copy. For example, bytes=0-9 indicates that you want to copy the first ten bytes of the source. You can copy a range only if the source object is greater than 5 GB.
--API-CopySourceSSECustomerAlgorithm=[string]Specifies the algorithm to use when decrypting the source object (e.g., AES256).
--API-CopySourceSSECustomerKeyMD5=[string]Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required
--API-CopySourceSSECustomerKey=[string]Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The encryption key provided in this header must be one that was used when the source object was created.
--API-ETag=[string]Entity tag returned when the part was uploaded.
--API-Expires=[datetime]The date and time at which the object is no longer cacheable.
--API-GrantFullControl=[string]Gives the grantee READ,
$ claude mcp add s4cmd \
-- python -m otcore.mcp_server <graph>