2017-05-09 11:40:42 +00:00
|
|
|
load 'config.rb'
|
|
|
|
|
|
|
|
users = USERNAMES
|
|
|
|
shot_dir = SHOT_DIR
|
|
|
|
log_dir = LOG_DIR
|
|
|
|
|
2017-01-24 16:09:09 +00:00
|
|
|
users.each do |user|
|
2017-05-09 11:40:42 +00:00
|
|
|
size = `du -B1 #{shot_dir}#{user}/ | awk {'print $1'} | head -n 1`
|
2017-10-14 10:19:02 +00:00
|
|
|
count = Dir["#{shot_dir}#{user}/*"].length
|
2017-01-24 19:32:52 +00:00
|
|
|
|
2017-10-14 10:19:02 +00:00
|
|
|
size.delete! "\n"
|
2017-01-26 15:08:01 +00:00
|
|
|
|
2017-05-09 11:40:42 +00:00
|
|
|
File.open("#{log_dir}/#{user}.log","a") do |f|
|
|
|
|
f << "#{Time.now.to_i} #{count} #{size}\n"
|
|
|
|
end
|
2017-01-24 16:09:09 +00:00
|
|
|
end
|