ubuntuamazon-s3s3cmd

s3cmd delete after upload


I am trying to upload files from a folder on my machine onto s3 and delete the file from my local machine after the upload is complete.

I have a cron running every minute with this command, but it isn't working:

s3cmd sync -r --delete-after /home/username/Videos/* s3://bucketname

whats wrong with this? I can upload using s3cmd sync so the config isn't wrong - but the delete after command doesn't seem to work.


Solution

  • --delete-after is used to delete removed files at the destination after uploading the new files. It lets remote trees stay consistent until the uploads of new content are complete. It does not delete files from the source.