.\" !!! IMPORTANT: This file is generated from s3cmd --help output using format-manpage.pl
.\" !!! Do your changes either in s3cmd file or in 'format-manpage.pl' otherwise
.\" !!! they will be overwritten!
.TH s3cmd 1
s3cmd \- tool for managing Amazon S3 storage space and Amazon CloudFront content delivery network
[\fIOPTIONS\fR] \fICOMMAND\fR [\fIPARAMETERS\fR]
is a command line client for copying files to/from
Amazon S3 (Simple Storage Service) and performing other
related tasks, for instance creating and removing buckets,
listing objects, etc.
can do several \fIactions\fR specified by the following \fIcommands\fR.
s3cmd \fBmb\fR \fIs3://BUCKET\fR
s3cmd \fBrb\fR \fIs3://BUCKET\fR
s3cmd \fBls\fR \fI[s3://BUCKET[/PREFIX]]\fR
List objects or buckets
s3cmd \fBla\fR \fI\fR
List all object in all buckets
s3cmd \fBput\fR \fIFILE [FILE...] s3://BUCKET[/PREFIX]\fR
Put file into bucket
s3cmd \fBget\fR \fIs3://BUCKET/OBJECT LOCAL_FILE\fR
Get file from bucket
s3cmd \fBdel\fR \fIs3://BUCKET/OBJECT\fR
Delete file from bucket
s3cmd \fBsync\fR \fILOCAL_DIR s3://BUCKET[/PREFIX] or s3://BUCKET[/PREFIX] LOCAL_DIR\fR
Synchronize a directory tree to S3
s3cmd \fBdu\fR \fI[s3://BUCKET[/PREFIX]]\fR
Disk usage by buckets
s3cmd \fBinfo\fR \fIs3://BUCKET[/OBJECT]\fR
Get various information about Buckets or Files
s3cmd \fBcp\fR \fIs3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2]\fR
s3cmd \fBmv\fR \fIs3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2]\fR
s3cmd \fBsetacl\fR \fIs3://BUCKET[/OBJECT]\fR
Modify Access control list for Bucket or Files
s3cmd \fBsetpolicy\fR \fIFILE s3://BUCKET\fR
Modify Bucket Policy
s3cmd \fBdelpolicy\fR \fIs3://BUCKET\fR
Delete Bucket Policy
s3cmd \fBmultipart\fR \fIs3://BUCKET [Id]\fR
show multipart uploads
s3cmd \fBabortmp\fR \fIs3://BUCKET/OBJECT Id\fR
abort a multipart upload
s3cmd \fBlistmp\fR \fIs3://BUCKET/OBJECT Id\fR
list parts of a multipart upload
s3cmd \fBaccesslog\fR \fIs3://BUCKET\fR
Enable/disable bucket access logging
s3cmd \fBsign\fR \fISTRING-TO-SIGN\fR
Sign arbitrary string using the secret key
s3cmd \fBsignurl\fR \fIs3://BUCKET/OBJECT expiry_epoch\fR
Sign an S3 URL to provide limited public access with expiry
s3cmd \fBfixbucket\fR \fIs3://BUCKET[/PREFIX]\fR
Fix invalid file names in a bucket
Commands for static WebSites configuration
s3cmd \fBws-create\fR \fIs3://BUCKET\fR
Create Website from bucket
s3cmd \fBws-delete\fR \fIs3://BUCKET\fR
s3cmd \fBws-info\fR \fIs3://BUCKET\fR
Info about Website
Commands for CloudFront management
s3cmd \fBcflist\fR \fI\fR
List CloudFront distribution points
s3cmd \fBcfinfo\fR \fI[cf://DIST_ID]\fR
Display CloudFront distribution point parameters
s3cmd \fBcfcreate\fR \fIs3://BUCKET\fR
Create CloudFront distribution point
s3cmd \fBcfdelete\fR \fIcf://DIST_ID\fR
Delete CloudFront distribution point
s3cmd \fBcfmodify\fR \fIcf://DIST_ID\fR
Change CloudFront distribution point parameters
s3cmd \fBcfinvalinfo\fR \fIcf://DIST_ID[/INVAL_ID]\fR
Display CloudFront invalidation request(s) status
Some of the below specified options can have their default
values set in
config file (by default $HOME/.s3cmd). As it's a simple text file
feel free to open it with your favorite text editor and do any
changes you like.
show this help message and exit
Invoke interactive (re)configuration tool. Optionally
use as '\fB--configure\fR s3://some-bucket' to test access
to a specific bucket instead of attempting to list
\fB\-c\fR FILE, \fB\-\-config\fR=FILE
Config file name. Defaults to /home/mludvig/.s3cfg
Dump current configuration after parsing config files
and command line options and exit.
AWS Access Key
AWS Secret Key
Only show what should be uploaded or downloaded but
don't actually do it. May still perform S3 requests to
get bucket listings and other information though (only
for file transfer commands)
Encrypt files before uploading to S3.
Don't encrypt files.
Force overwrite and other dangerous operations.
Continue getting a partially downloaded file (only for
Continue uploading partially uploaded files or
multipart upload parts. Restarts/parts files that
don't have matching size and md5. Skips files/parts
that do. Note: md5sum checks are not always
sufficient to check (part) file equality. Enable this
at your own risk.
UploadId for Multipart Upload, in case you want
continue an existing upload (equivalent to \fB--continue-\fR
put) and there are multiple partial uploads. Use
s3cmd multipart [URI] to see what UploadIds are
associated with the given URI.
Skip over files that exist at the destination (only
for [get] and [sync] commands).
Recursive upload, download or removal.
Check MD5 sums when comparing files for [sync].
Do not check MD5 sums when comparing files for [sync].
Only size will be compared. May significantly speed up
transfer but may also miss some changed files.
Store objects with ACL allowing read for anyone.
Store objects with default ACL allowing access for you
\fB\-\-acl\-grant\fR=PERMISSION:EMAIL or USER_CANONICAL_ID
Grant stated permission to a given amazon user.
Permission is one of: read, write, read_acp,
write_acp, full_control, all
Revoke stated permission for a given amazon user.
Permission is one of: read, write, read_acp, wr
ite_acp, full_control, all
Delete remote objects with no corresponding local file
Don't delete remote objects.
Perform deletes after new uploads [sync]
Put all updated files into place at end [sync]
Do not delete more than NUM files. [del] and [sync]
Additional destination for parallel uploads, in
addition to last arg. May be repeated.
Delete remote objects after fetching to local file
(only for [get] and [sync] commands).
Preserve filesystem attributes (mode, ownership,
timestamps). Default for [sync] command.
Don't store FS attributes
Filenames and paths matching GLOB will be excluded
Read --exclude GLOBs from FILE
Filenames and paths matching REGEXP (regular
expression) will be excluded from sync
Read --rexclude REGEXPs from FILE
Filenames and paths matching GLOB will be included
even if previously excluded by one of
Read --include GLOBs from FILE
Same as --include but uses REGEXP (regular expression)
instead of GLOB
Read --rinclude REGEXPs from FILE
Don't exit unsuccessfully because of missing keys
Read list of source-file names from FILE. Use - to
read from stdin.
Datacentre to create bucket in. As of now the
datacenters are: US (default), EU, ap-northeast-1, ap-
southeast-1, sa-east-1, us-west-1 and us-west-2
Store object with 'Reduced redundancy'. Lower per-GB
price. [put, cp, mv]
Target prefix for access logs (S3 URI) (for [cfmodify]
and [accesslog] commands)
Disable access logging (for [cfmodify] and [accesslog]
Default MIME-type for stored objects. Application
default is binary/octet-stream.
Guess MIME-type of files by their extension or mime
magic. Fall back to default MIME-Type as specified by
Don't guess MIME-type and use the default type
Don't use mime magic when guessing MIME-type.
\fB\-m\fR MIME/TYPE, \fB\-\-mime\-type\fR=MIME/TYPE
Force MIME-type. Override both \fB--default-mime-type\fR and
Add a given HTTP header to the upload request. Can be
used multiple times. For instance set 'Expires' or
'Cache-Control' headers (or both) using this options
if you like.
Specifies that server-side encryption will be used
when putting objects.
Override autodetected terminal and filesystem encoding
(character set). Autodetected: UTF-8
Don't include a Content-encoding header to the the
Add encoding to these comma delimited extensions i.e.
(css,js,html) when uploading to S3 )
Use the S3 name as given on the command line. No pre-
processing, encoding, etc. Use with caution!
Disable multipart upload on files bigger than
Size of each chunk of a multipart upload. Files bigger
than SIZE are automatically uploaded as multithreaded-
multipart, smaller files are uploaded using the
traditional method. SIZE is in Mega-Bytes, default
chunk size is noneMB, minimum allowed chunk size is
5MB, maximum is 5GB.
Include MD5 sums in bucket listings (only for 'ls'
Print sizes in human readable form (eg 1kB instead of
Name of index-document (only for [ws-create] command)
Name of error-document (only for [ws-create] command)
Display progress meter (default on TTY).
Don't display progress meter (default on non-TTY).
Enable given CloudFront distribution (only for
Enable given CloudFront distribution (only for
Invalidate the uploaded filed in CloudFront. Also see
When using Custom Origin and S3 static website,
invalidate the default index file.
When using Custom Origin and S3 static website, don't
invalidate the path to the default index file.
Add given CNAME to a CloudFront distribution (only for
[cfcreate] and [cfmodify] commands)
Remove given CNAME from a CloudFront distribution
(only for [cfmodify] command)
Set COMMENT for a given CloudFront distribution (only
for [cfcreate] and [cfmodify] commands)
Set the default root object to return when no object
is specified in the URL. Use a relative path, i.e.
default/index.html instead of /default/index.html or
s3://bucket/default/index.html (only for [cfcreate]
and [cfmodify] commands)
Enable verbose output.
Enable debug output.
Show s3cmd version (1.5.0-beta1) and exit.
Follow symbolic links as if they are regular files
Cache FILE containing local source MD5 values
Silence output on stdout
One of the most powerful commands of \fIs3cmd\fR is \fBs3cmd sync\fR used for
synchronising complete directory trees to or from remote S3 storage. To some extent
\fBs3cmd put\fR and \fBs3cmd get\fR share a similar behaviour with \fBsync\fR.
Basic usage common in backup scenarios is as simple as:
s3cmd sync /local/path/ s3://test-bucket/backup/
This command will find all files under /local/path directory and copy them
to corresponding paths under s3://test-bucket/backup on the remote side.
/local/path/\fBfile1.ext\fR \-> s3://bucket/backup/\fBfile1.ext\fR
/local/path/\fBdir123/file2.bin\fR \-> s3://bucket/backup/\fBdir123/file2.bin\fR
However if the local path doesn't end with a slash the last directory's name
is used on the remote side as well. Compare these with the previous example:
s3cmd sync /local/path s3://test-bucket/backup/
/local/\fBpath/file1.ext\fR \-> s3://bucket/backup/\fBpath/file1.ext\fR
/local/\fBpath/dir123/file2.bin\fR \-> s3://bucket/backup/\fBpath/dir123/file2.bin\fR
To retrieve the files back from S3 use inverted syntax:
s3cmd sync s3://test-bucket/backup/ /tmp/restore/
that will download files:
s3://bucket/backup/\fBfile1.ext\fR \-> /tmp/restore/\fBfile1.ext\fR
s3://bucket/backup/\fBdir123/file2.bin\fR \-> /tmp/restore/\fBdir123/file2.bin\fR
Without the trailing slash on source the behaviour is similar to
what has been demonstrated with upload:
s3cmd sync s3://test-bucket/backup /tmp/restore/
will download the files as:
s3://bucket/\fBbackup/file1.ext\fR \-> /tmp/restore/\fBbackup/file1.ext\fR
s3://bucket/\fBbackup/dir123/file2.bin\fR \-> /tmp/restore/\fBbackup/dir123/file2.bin\fR
All source file names, the bold ones above, are matched against \fBexclude\fR
rules and those that match are then re\-checked against \fBinclude\fR rules to see
whether they should be excluded or kept in the source list.
For the purpose of \fB\-\-exclude\fR and \fB\-\-include\fR matching only the
bold file names above are used. For instance only \fBpath/file1.ext\fR is tested
against the patterns, not \fI/local/\fBpath/file1.ext\fR
Both \fB\-\-exclude\fR and \fB\-\-include\fR work with shell-style wildcards (a.k.a. GLOB).
For a greater flexibility s3cmd provides Regular-expression versions of the two exclude options
named \fB\-\-rexclude\fR and \fB\-\-rinclude\fR.
The options with ...\fB\-from\fR suffix (eg \-\-rinclude\-from) expect a filename as
an argument. Each line of such a file is treated as one pattern.
There is only one set of patterns built from all \fB\-\-(r)exclude(\-from)\fR options
and similarly for include variant. Any file excluded with eg \-\-exclude can
be put back with a pattern found in \-\-rinclude\-from list.
Run s3cmd with \fB\-\-dry\-run\fR to verify that your rules work as expected.
Use together with \fB\-\-debug\fR get detailed information
about matching file names against exclude and include rules.
For example to exclude all files with ".jpg" extension except those beginning with a number use:
\-\-exclude '*.jpg' \-\-rinclude '[0-9].*\.jpg'
.SH SEE ALSO
For the most up to date list of options run
.B s3cmd \-\-help
For more info about usage, examples and other related info visit project homepage at
Please consider a donation if you have found s3cmd useful:
Written by Michal Ludvig <email@example.com> and 15+ contributors
.SH CONTACT, SUPPORT
Preferred way to get support is our mailing list:
.SH REPORTING BUGS
Report bugs to
Copyright \(co 2007,2008,2009,2010,2011,2012 Michal Ludvig <http://www.logix.cz/michal>
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License version 2 <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.