Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
delete old files
Name: Junes Date: October 6, 2006 at 06:31:08 Pacific OS: sol CPU/Ram: na Product: na
Comment:
Can someone assist
I want to delete files in the following directory /usr/openv/java/logs/ which are more than 7 days old
-rw-r----- 1 root other 426 Sep 26 09:34 root.jnbSA.3929.log -rw-r----- 1 root other 404 Sep 26 14:30 root.jnbSA.1165.log -rw-r--r-- 1 root other 1283 Sep 27 15:47 root.jnbSA.1818.log -rw-r--r-- 1 root other 403 Sep 27 15:50 root.jnbSA.2068.log -rw-r----- 1 root other 57072 Sep 27 17:18 root.jnbSA.12028.log -rw-r----- 1 root other 404 Sep 28 09:10 root.jnbSA.3762.log -rw-r--r-- 1 root other 427 Sep 28 09:17 root.jnbSA.4579.log -rw-r--r-- 1 root other 94409 Sep 29 14:09 root.jnbSA.22253.log -rw-r----- 1 root other 1058 Oct 1 11:46 root.jnbSA.21843.log -rw-r----- 1 root other 681 Oct 1 14:01 root.jnbSA.25458.log
Summary: I need a ftp script to delete old text files on a remote server based on the file retention rules such as 2 weeks, 1 month, etc. It can be written as a Korn script or Perl. Thanks for your help. ...
Summary: Ohh, the script should be run from cron at the interval in minutes you are looking for old files. i.e. if you want to remove files that are older that 30 minutes old, run the script every 30 minutes....