I want to find out files that are older than x days (time and weekends don't count for the purpose of calculating a file's age). I need to use only weekdays.
My script is working but only if the date from the range are within the same month. Otherwise the range size is 0.
I run the script via ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
Dir['*.gdb'].each { |db|
puts db
puts ((Date.strptime(File.mtime(db).strftime("%Y-%m-%d")))..(Date.today)).select {|d| (1..5).include?(d.wday) }.size
}
any idea how I can make it work?