How to delete files in slot of 1000 leaving 7 days of history
Hey all,
I want to create a script which can delete the files older than 7 days but in a slot of 1000. As i have millions of file to delete which i need to perform 1000 files in one slot then next 1000 files and so on. The start state should be 7 days before the present date. I tried deleting all the files after 7 days but it has thrown the below error so want to do it in slot of 1000 files.
error : /usr/bin/find: arg list too long
usage: rm [-fiRr] file ...
Please suggest on this.
Thanks,
Ankit
|