Cron: Argument list too long - wtf?

Discussion in 'Site & Server Administration' started by Kerosene, Mar 26, 2008.

  1. #1
    I've got a simple cron job that empties a directory full of cache files every day.
    rm -rf /home/username/mycache/*

    Sometimes when the directory has a ton of files in it, I get this error:
    When this happens, the files don't get deleted, so I have to manually go in and remove them myself.

    Is there anyway to get around this?
     
    Kerosene, Mar 26, 2008 IP
  2. gate2vn

    gate2vn Peon

    Messages:
    809
    Likes Received:
    33
    Best Answers:
    1
    Trophy Points:
    0
    #2
    You might want to delete files by date? Something likes this
     
    gate2vn, Mar 26, 2008 IP