You should indeed use the --exclude
option. If you want to sync every file on the root but not the folders, you should try :
s3cmd --exclude="/*/*" sync local/ s3://s3bucket
Keep in mind that a folder doesn't really exist on S3. What seems to be a file file
in a folder folder
is just a file named folder/file
! So you just have to exclude file with the pattern /*/*
.