nocabt
nocabt

Reputation: 1131

Unable to exclude directories from s3cmd sync

I'm having an issue excluding directories on a nightly backup script using S3cmd.

I'm trying to exclude certain files from being backed up (log files, etc...)

My server structure is:

/srv/users/USERNAME/
/srv/users/USERNAME2/

etc...

So I'm running an s3cmd on cron, similar to:

s3cmd sync --config=/path/to/config/.s3cfg --delete-removed --exclude-from=/path/to/exclude/backups.exclude /srv/ s3://aws-bucket/

where my backups.exclude file contains:

/srv/users/*/log
/srv/users/*/run

As well as some other similar directories. As should be obvious, I'd like to catch all user directories with that wildcard to exclude them from backup.

However, it doesn't seem to be working. I'm currently running s3cmd version 2 (I upgraded to see if maybe it was a bug).

Thanks!

Upvotes: 1

Views: 519

Answers (1)

nocabt
nocabt

Reputation: 1131

Ok I figured this out, it was related to the paths. For the sync source, I used /srv (no slash) instead of /srv/ and also updated the excludes file to remove the starting slash, srv/users/*/log/ and added a trailing slash.

Upvotes: 1

Related Questions