Loading ...
Sorry, an error occurred while loading the content.

Facing problem in shell script

Expand Messages
  • vadi raj
    Respected Sir/Madam, I want to write shell script to delete files based on file creation datetime. If a file or folder is 30 minutes old then it should delete.
    Message 1 of 1 , Oct 16, 2006
    • 0 Attachment
      Respected Sir/Madam,

      I want to write shell script to delete files based on file creation datetime. If a file or folder is 30 minutes old then it should delete.

      It shouldn't delete viewedit folder.

      Example
      I have a folder /temp/temp_files under this we have viewedit folder [/temp/temp_files/viewedit] and also so many different folders and file will be there. [Folder and files will be generated by application]
      Now except viewedit folder I need to delete all file and folder form /temp/temp_files this location if it is 30 minutes old.

      By using find command I am facing lot of problem
      i have used like this
      find /temp/temp_files/* ! \( -name viewedit -prune \) -a \( -mmin +30 \) -exec rm -rf {}  \;

      Please can any one help me in this..it will be great helpful for me.

      I will wait for the response

      Thanks and regards,
      vadiraj


      Get your own >web address for just $1.99/1st yr. We'll help. Yahoo! Small Business.
    Your message has been successfully submitted and would be delivered to recipients shortly.