Skip to content

Instantly share code, notes, and snippets.

@Chryus
Created December 26, 2016 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chryus/f8b87bd32c746cf29c26d7074e621535 to your computer and use it in GitHub Desktop.
Save Chryus/f8b87bd32c746cf29c26d7074e621535 to your computer and use it in GitHub Desktop.
require './app/services/fog_service'
require 'task_helpers/clean_up_helper'
task :upload_jobs do
Dir.glob("tmp/uploads/*/*.*") do |file|
age = CleanUpHelper.file_age(file)
if age > 300
fog = FogService.create
destination = fog.directories.get('default-submissions-uploads')
destination.files.create(key: file.split("/").last, body: File.read(file))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment