dcav-stats/update.rb

17 lines
343 B
Ruby
Raw Permalink Normal View History

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`
count = Dir["#{shot_dir}#{user}/*"].length
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