s3cmd.1
dd4fec78
 .TH s3cmd 1
 .SH NAME
bf42f420
 s3cmd \- tool for managing Amazon S3 storage space
dd4fec78
 .SH SYNOPSIS
 .B s3cmd
 [\fIOPTIONS\fR] \fICOMMAND\fR [\fIPARAMETERS\fR]
 .SH DESCRIPTION
 .PP
 .B s3cmd
 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.
 .PP
 .B s3cmd
 can do several \fIactions\fR specified by the following \fIcommands\fR.
 .TP
 \fBmb\fR \fIs3://BUCKET\fR
 Make bucket
 .TP
 \fBrb\fR \fIs3://BUCKET\fR
 Remove bucket
 .TP
 \fBls\fR \fI[s3://BUCKET[/PREFIX]]\fR
 List objects or buckets
 .TP
 \fBla\fR
 List all object in all buckets
 .TP
 \fBput\fR \fIFILE [FILE...] s3://BUCKET[/PREFIX]\fR
7393bdba
 Put file into bucket (i.e. upload to S3)
dd4fec78
 .TP
 \fBget\fR \fIs3://BUCKET/OBJECT LOCAL_FILE\fR
7393bdba
 Get file from bucket (i.e. download from S3)
dd4fec78
 .TP
 \fBdel\fR \fIs3://BUCKET/OBJECT\fR
 Delete file from bucket
f298b348
 .TP
7393bdba
 \fBsync\fR \fILOCAL_DIR s3://BUCKET[/PREFIX]\fR
29893afc
 Backup a directory tree to S3
 .TP
 \fBsync\fR \fIs3://BUCKET[/PREFIX] LOCAL_DIR\fR
 Restore a tree from S3 to local directory
7393bdba
 .TP
 \fBinfo\fR \fIs3://BUCKET[/OBJECT]\fR
 Get various information about a Bucket or Object
 .TP
f298b348
 \fBdu\fR \fI[s3://BUCKET[/PREFIX]]\fR
bf42f420
 Disk usage \- amount of data stored in S3
dd4fec78
 
 .SH OPTIONS
 .PP
 Some of the below specified options can have their default 
 values set in 
 .B s3cmd
 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.
 .PP
 Config file related options.
 .TP
bf42f420
 \fB\-\-configure\fR
dd4fec78
 Invoke interactive (re)configuration tool. Don't worry, you won't 
 lose your settings on subsequent runs.
 .TP
bf42f420
 \fB\-c\fR FILE, \fB\-\-config\fR=FILE
dd4fec78
 Config file name. Defaults to $HOME/.s3cfg
 .TP
bf42f420
 \fB\-\-dump\-config\fR
dd4fec78
 Dump current configuration after parsing config files
 and command line options and exit.
 .PP
7393bdba
 Most options can have a default value set in the above specified config file.
 .PP
 Options specific to \fBsync\fR command:
 .TP
 \fB\-\-delete\-removed\fR
29893afc
 Delete remote objects with no corresponding local file when \fIsync\fRing \fBto\fR S3 or delete local files with no corresponding object in S3 when \fIsync\fRing \fBfrom\fR S3.
7393bdba
 .TP
 \fB\-\-no\-delete\-removed\fR
 Don't delete remote objects. Default for 'sync' command.
 .TP
 \fB\-p\fR, \fB\-\-preserve\fR
 Preserve filesystem attributes (mode, ownership, timestamps). Default for 'sync' command.
 .TP
 \fB\-\-no\-preserve\fR
 Don't store filesystem attributes with uploaded files.
ee852c0a
 .TP
2d7d5543
 \fB\-\-exclude GLOB\fR
 Exclude files matching GLOB (a.k.a. shell-style wildcard) from \fIsync\fI. See SYNC COMMAND section for more information.
ee852c0a
 .TP
 \fB\-\-exclude\-from FILE\fR
2d7d5543
 Same as \-\-exclude but reads GLOBs from the given FILE instead of expecting them on the command line.
 .TP
 \fB\-\-rexclude REGEXP\fR
 Same as \-\-exclude but works with REGEXPs (Regular expressions).
 .TP
 \fB\-\-rexclude\-from FILE\fR
 Same as \-\-exclude\-from but works with REGEXPs.
ee852c0a
 .TP
3490bb40
 \fB\-\-debug\-syncmatch\fR or \fB\-\-debug\-exclude\fR (alias)
d5e87cdf
 Display detailed information about matching file names against exclude\-rules as well as information about remote vs local filelists matching. S3cmd exits after performing the match and no actual transfer takes place.
29893afc
 .\".TP
 .\"\fB\-n\fR, \fB\-\-dry\-run\fR
 .\"Only show what would be uploaded or downloaded but don't actually do it. May still perform S3 requests to get bucket listings and other information though.
7393bdba
 .PP
 Options common for all commands (where it makes sense indeed):
dd4fec78
 .TP
bf42f420
 \fB\-f\fR, \fB\-\-force\fR
dd4fec78
 Force overwrite and other dangerous operations.
 .TP
bf42f420
 \fB\-P\fR, \fB\-\-acl\-public\fR
7393bdba
 Store objects with permissions allowing read for anyone.
 .TP
 \fB\-\-acl\-private\fR
 Store objects with default ACL allowing access for you only.
 .TP
 \fB\-\-bucket\-location\fR=BUCKET_LOCATION
 Specify datacentre where to create the bucket. Possible values are \fIUS\fR (default) or \fIEU\fR.
dd4fec78
 .TP
18c4a150
 \fB\-e\fR, \fB\-\-encrypt\fR
 Use GPG encryption to protect stored objects from unauthorized access.
 .TP
bf42f420
 \fB\-m\fR MIME/TYPE, \fB\-\-mime\-type\fR=MIME/TYPE
 Default MIME\-type to be set for objects stored.
dd4fec78
 .TP
bf42f420
 \fB\-M\fR, \fB\-\-guess\-mime\-type\fR
 Guess MIME\(hytype of files by their extension. Falls
 back to default MIME\(hyType as specified by \fB\-\-mime\-type\fR
dd4fec78
 option
 .TP
bf42f420
 \fB\-H\fR, \fB\-\-human\-readable\-sizes\fR
dd4fec78
 Print sizes in human readable form.
 .\".TP
bf42f420
 .\"\fB\-u\fR, \fB\-\-show\-uri\fR
dd4fec78
 .\"Show complete S3 URI in listings.
 .TP
bf42f420
 \fB\-v\fR, \fB\-\-verbose\fR
dd4fec78
 Enable verbose output.
 .TP
bf42f420
 \fB\-d\fR, \fB\-\-debug\fR
dd4fec78
 Enable debug output.
 .TP
bf42f420
 \fB\-h\fR, \fB\-\-help\fR
dd4fec78
 Show the help message and exit
 .TP
bf42f420
 \fB\-\-version\fR
dd4fec78
 Show
 .B s3cmd
 version and exit.
 
ee852c0a
 .SH SYNC COMMAND
 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. 
 .PP
 Basic usage common in backup scenarios is as simple as:
 .nf
 	s3cmd sync /local/path s3://test-bucket/backup
 .fi
 .PP
 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.
 For example:
 .nf
d9a3c848
 /local/path\fB/file1.ext\fR         \->  s3://test-bucket/backup\fB/file1.ext\fR
 /local/path\fB/dir123/file2.bin\fR  \->  s3://test-bucket/backup\fB/dir123/file2.bin\fR
ee852c0a
 .fi
 
 To retrieve the files back from S3 use inverted syntax:
 .nf
 	s3cmd sync s3://test-bucket/backup/ /tmp/restore
 .fi
 that will download files:
 .nf
d9a3c848
 s3://test-bucket/backup\fB/file1.ext\fR         \->  /tmp/restore\fB/file1.ext\fR       
 s3://test-bucket/backup\fB/dir123/file2.bin\fR  \->  /tmp/restore\fB/dir123/file2.bin\fR
ee852c0a
 .fi
 
 For the purpose of \fB\-\-exclude\fR and \fB\-\-exclude\-from\fR matching the file name 
 \fIalways\fR begins with \fB/\fR (slash) and has the local or remote common part removed.
d9a3c848
 For instance in the previous example the file names tested against \-\-exclude list
ee852c0a
 will be \fB/\fRfile1.ext and \fB/\fRdir123/file2.bin, that is both with the leading 
 slash regardless whether you specified s3://test-bucket/backup or 
 s3://test-bucket/backup/ (note the trailing slash) on the command line.
 
2d7d5543
 Both \fB\-\-exclude\fR and \fB\-\-exclude\-from\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\-\-rexclude\-from\fR. 
 
 Run s3cmd with \fB\-\-debug\-syncmatch\fR to get detailed information
d5e87cdf
 about matching file names against exclude rules.
ee852c0a
 
2d7d5543
 For example to exclude all files with ".bin" extension with a REGEXP use:
 .PP
 	\-\-rexclude '\.bin$'
ee852c0a
 .PP
2d7d5543
 to exclude all hidden files and subdirectories (i.e. those whose name begins with dot ".") use GLOB:
ee852c0a
 .PP
2d7d5543
 	\-\-exclude '/.*'
ee852c0a
 .PP
2d7d5543
 on the other hand to exclude only hidden files but not hidden subdirectories use REGEXP:
ee852c0a
 .PP
2d7d5543
 	\-\-rexclude '/\.[^/]*$'
ee852c0a
 .PP
2d7d5543
 etc...
ee852c0a
 
dd4fec78
 .SH AUTHOR
 Written by Michal Ludvig <michal@logix.cz>
 .SH REPORTING BUGS
 Report bugs to 
bf42f420
 .I s3tools\-general@lists.sourceforge.net
dd4fec78
 .SH COPYRIGHT
7393bdba
 Copyright \(co 2007,2008 Michal Ludvig <http://www.logix.cz/michal>
dd4fec78
 .br
 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.
 .SH SEE ALSO
 For the most up to date list of options run 
bf42f420
 .B s3cmd \-\-help
dd4fec78
 .br
 For more info about usage, examples and other related info visit project homepage at
 .br
 .B http://s3tools.logix.cz