I'm a python newb so please be gentle..
I'm using glob to gather a list of files that match a specific pattern
for name in glob.glob('/home/myfiles/*_customer_records_2323_*.zip')
print '\t', name
The output is then something like
/home/myfiles/20130110_customer_records_2323_something.zip
/home/myfiles/20130102_customer_records_2323_something.zip
/home/myfiles/20130101_customer_records_2323_something.zip
/home/myfiles/20130103_customer_records_2323_something.zip
/home/myfiles/20130104_customer_records_2323_something.zip
/home/myfiles/20130105_customer_records_2323_something.zip
/home/myfiles/20130107_customer_records_2323_something.zip
/home/myfiles/20130106_customer_records_2323_something.zip
But I would like the output to be only the newest 5 files only (via the timestap or the os reported creation time)
/home/myfiles/20130106_customer_records_2323_something.zip
/home/myfiles/20130107_customer_records_2323_something.zip
/home/myfiles/20130108_customer_records_2323_something.zip
/home/myfiles/20130109_customer_records_2323_something.zip
/home/myfiles/20130110_customer_records_2323_something.zip
And Idea on how I can accomplish this? (have the list be sorted and then contain only the newest 5 files?)
UPDATE Modified to show how output from glob is NOT sorted by default