Guest User

Untitled

a guest
Jul 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. u = Ii::Person.find_by_slug('guest')
  2. old = u.artwork.select{|i| i.created_at < 2.weeks.ago }
  3. files = old.map{|i| i.source_image.path rescue nil}
  4. files.reject!{|f| f.nil? }
  5. folders = []
  6. files.each { |f| folders << f.split('/')[0,f.split('/').size-1].join('/') }
  7. sizes = []
  8. folders.map {|f| sizes << `du -s public#{f}` }
  9. sizes.map! {|s| s.split("\t")[0].to_i }
  10. kilobytes = sizes.sum
Add Comment
Please, Sign In to add comment