[ALUG] Scripting help: deleting old directories

Mark Rogers mark at quarella.co.uk
Wed Dec 22 13:25:19 GMT 2010


On 22/12/10 12:58, Chris G wrote:
> I think that's just about the level of 'difficultness' where I move from
> a bash script to python.  IMHO Python lends itself very well to jobs
> like this.  Python has a ready made function that 'walks' a directory
> tree like find does so all you need is a bit of logic to check if all
> the files in a directory are older than x and, if so, delete the directory

Hmmm, learning Python is on the to-do list but the way things are at the 
moment I don't see it offering me a solution to this unless I can find some 
sample code that's pretty close - any suggestions? Might be a good way for me 
to get started down the Python route.

-- 
Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450
Registered in England (0456 0902) @ 13 Clarke Rd, Milton Keynes, MK1 1LG




More information about the main mailing list