#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    7
    Rep Power
    0

    Deleting File Older than 7 days


    Hi,

    In Windows I am trying to use perl to delete all files from a folder which are more than 7 days old.

    Any code suggestions pls.


    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,940
    Rep Power
    1225
    You can use the -M file test operator to get the mtime age of the file in days. If it's grater than 7, delete the file.

IMN logo majestic logo threadwatch logo seochat tools logo