for file in $(find . -type f -mmin -240)
do
filename=$(echo "$file" | cut -d'.' --complement -s -f1)
s3cmd put $file s3://${bucketname}/$filename
done
I am trying to do the above in order to upload all files that have changed in the last 4 hours to a bucket in amazon but because many of the files have spaces in them, this is not working.
I keep getting the following error:
ERROR: Parameter problem: Nothing to upload.
I know I could use sync instead of put but I don't want to do that because this folder has over 30K files and that would mean that sync has to check and forth in the server and it would take ages and cost extra money.
Anyone knows how to pass variables that contain spaces to this to make it work?