Browse files

* s3cmd.1, NEWS: Document --exclude

git-svn-id: 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information...
1 parent 711318e commit ee852c0a142518cca38a58cdf517a5c411134b36 @mludvig mludvig committed Jun 9, 2008
Showing with 68 additions and 0 deletions.
  1. +1 −0 ChangeLog
  2. +4 −0 NEWS
  3. +4 −0 TODO
  4. +59 −0 s3cmd.1
@@ -1,6 +1,7 @@
2008-06-10 Michal Ludvig <>
* s3cmd: Added --exclude switch for sync.
+ * s3cmd.1, NEWS: Document --exclude
2008-06-05 Michal Ludvig <>
@@ -1,3 +1,7 @@
+s3cmd 0.9.8 - ????
+* Added --exclude option for sync command.
s3cmd 0.9.7 - 2008-06-05
* Implemented 'sync' from S3 back to local folder, including
@@ -1,6 +1,10 @@
TODO list for s3cmd project
+- Finish sync --exclude support.
+ - Add --exclude-from and --debug-exclude implementations.
+ - Support shell-style wildcards? Or rsync-style excludes?
- Treat objects with "/" in their name as directories
- Will need local cache for bucket listings
- More user friendly 'del' operation that would work
59 s3cmd.1
@@ -85,6 +85,15 @@ Preserve filesystem attributes (mode, ownership, timestamps). Default for 'sync'
Don't store filesystem attributes with uploaded files.
+\fB\-\-exclude REGEXP\fR
+Exclude files matching REGEXP from \fIsync\fI. See SYNC COMMAND section for more information.
+\fB\-\-exclude\-from FILE\fR
+Same as \-\-exclude but reads REGEXPs from the given FILE instead of expecting them on the command line.
+Display detailed information about matching file names against exclude\-rules.
.\"\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.
@@ -134,6 +143,56 @@ Show
.B s3cmd
version and exit.
+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.
+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.
+For example:
+/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
+To retrieve the files back from S3 use inverted syntax:
+ s3cmd sync s3://test-bucket/backup/ /tmp/restore
+that will download files:
+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
+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.
+For instance in the previous example the file names tested against --exclude list
+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.
+Both \fB\-\-exclude\fR and \fB\-\-exclude\-from\fR options expect regular expressions, not
+shell-style wildcards! Run s3cmd with \fB\-\-debug\-exclude\fR to get a detailed list of
+matching file names against exclude rules.
+For example to exclude all files with ".bin" extension use:
+ \-\-exclude '\.bin$'
+to exclude all hidden files and subdirectories (i.e. those whose name begins with dot ".") use:
+ \-\-exclude '/\.'
+on the other hand to exclude only hidden files but not hidden subdirectories use:
+ \-\-exclude '/\.[^/]*$'
Written by Michal Ludvig <>

0 comments on commit ee852c0

Please sign in to comment.