(date) script for freenas

Posted by malgaboy on Super User See other posts from Super User or by malgaboy
Published on 2012-07-04T09:10:44Z Indexed on 2012/07/04 9:18 UTC
Read the original article Hit count: 104

Filed under:
|
|
|

My webserver is running freenas 8.0.4. Currently in /etc/crontab there is this task (daily)

find /mnt/vol1/1 -type f -mtime +16 -exec rm -R {} \; This allow me to delete files older than 16 days.. infact every night a new file is added in /mnt/vol1/1 folder..

but now I wanna make a script that check the folder and keeps only the youngest 2 file.. whitout taking in consideration the days..

Thanks in advance. (sorry for my bad english).

© Super User or respective owner

Related posts about shell

Related posts about script