rsy2003
2010-04-27 14:36:45 UTC
Hi perl gurus,
I'm new to perl but ok on unix. I have a problem as system admin.
I have to do this almost every week where i need to list directory
contents on d:\drive of windows server and get top 5 files, take their
size and delete them.
i did use commands available on dos and also used unix head and grep
utils and made to get 5 files.
i used dir sort with size, made unix head -5 and then put that to
file,but i want to delete those and also compute size of d drive.
eg:
d:\test1.txt - 5kb
test2.txt 4kb
test3.txt 3kb
....
how can i write all in perl only?
thanks for any help
jay
I'm new to perl but ok on unix. I have a problem as system admin.
I have to do this almost every week where i need to list directory
contents on d:\drive of windows server and get top 5 files, take their
size and delete them.
i did use commands available on dos and also used unix head and grep
utils and made to get 5 files.
i used dir sort with size, made unix head -5 and then put that to
file,but i want to delete those and also compute size of d drive.
eg:
d:\test1.txt - 5kb
test2.txt 4kb
test3.txt 3kb
....
how can i write all in perl only?
thanks for any help
jay