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

    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

    Remove old files


    how to write a shell script, that should be find the 2 months old files(location ex:/home/gowtham).The file names are saved with the format of date(example for a file name is monthdayyear,04062013,04072013).The script can find only 2 months old files,names are like 04062013 and remaining files are not need in the output.
    please provide a solution for the problem……….

    Thanks
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,594
    Rep Power
    4207
    man find and look at the ctime and mtime options.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

    the find output will be show only dated names files(ex:MonthDayYear,04072013 only thi


    Thanks Scorpions4ever for ur quick reply

    but

    how to find or list (write a shell script), that should be find the 2 months old files(location ex:/home/gowtham).The file names are saved with the format of date(example for a file name is monthdayyear,04062013,04072013).The script can find only 2 months old files,names are like 04062013 and remaining files are not need in the output.
    please provide a solution for the problem……….
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    831
    Rep Power
    275
    This is NOT the "Do This For Me" forum....This is the "You do the work yourself and we'll try to help you along the way" forum.

    So, please make an attempt, yourself, to write this and someone like Scorpions4ever will most likely be able to "guide" you along the way.
  8. #5
  9. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,594
    Rep Power
    4207
    Originally Posted by jayapal
    Thanks Scorpions4ever for ur quick reply

    but

    how to find or list (write a shell script), that should be find the 2 months old files(location ex:/home/gowtham).The file names are saved with the format of date(example for a file name is monthdayyear,04062013,04072013).The script can find only 2 months old files,names are like 04062013 and remaining files are not need in the output.
    please provide a solution for the problem……….
    Did you even read my reply and look at the man page like I suggested?
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo