SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    cron/ssh to remove folders older than X days

    Does anyone know how to modify this code, so it automaticly deletes files without having to confirm each one?

    I have a few thousand files I need deleted and don't feel like pushing y that many times.

    Code:
    # this should remove files older than 2 days.
    find /path/to/data/ -name '*' -type f -mtime +2 -exec rm -v -r -i {} \;

  2. #2
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm kinda new to ssh commands, i just took the -v -r -i and it worked.... sorry for useless thread

  3. #3
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,177
    Mentioned
    233 Post(s)
    Tagged
    1 Thread(s)
    No probs. We didn't have to do anything and that's the job I like


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •