May 2, 2002 #1 umeman Technical User Oct 2, 2001 59 US Admins, I needs a korn shell script to delete files from a particular directory that is older that 1 day, If anyone has a scripts or any ideas on how to do this please forward your thoughts Thanks -u-
Admins, I needs a korn shell script to delete files from a particular directory that is older that 1 day, If anyone has a scripts or any ideas on how to do this please forward your thoughts Thanks -u-
May 3, 2002 #2 trunix Technical User Aug 1, 2001 191 GB Use the find command to locate all files older than one day and then remove them cd /dir find . -ctime +1 | xargs rm Remember when writing any script which removes files, test it thoroughly on dummy files / directories before running it on important files. Upvote 0 Downvote
Use the find command to locate all files older than one day and then remove them cd /dir find . -ctime +1 | xargs rm Remember when writing any script which removes files, test it thoroughly on dummy files / directories before running it on important files.