This rake task will update (delete and copy) all the files under a directory to S3, by default is the public directory but you can pass as argument the path to the folder.

The rake task will verify if the local file exist on s3 and if the local file have been modified since the upload to s3.

** Rails 2.3.4 **

In your Gemfile

gem 'syncassets_r2'

In your Rakefile

Dir["#{Gem.searcher.find('syncassets_r2').full_gem_path}/lib/tasks/**/*.rake"].each { |ext| load ext }

In your config/aws.yml

development:
  access_key_id:     'YOUR_ACCESS_KEY'
  secret_access_key: 'YOUR_SECRET_ACCESS_KEY'
  bucket:            'YOUR_BUCKET_NAME'
test:
  access_key_id:     'YOUR_ACCESS_KEY'
  secret_access_key: 'YOUR_SECRET_ACCESS_KEY'
  bucket:            'YOUR_BUCKET_NAME'
production:
  access_key_id:     'YOUR_ACCESS_KEY'
  secret_access_key: 'YOUR_SECRET_ACCESS_KEY'
  bucket:            'YOUR_BUCKET_NAME'