new to putty

Discussion in 'Site & Server Administration' started by Colbro1, Jun 14, 2010.

  1. #1
    Hi,
    I have a customer who is running Asterix PBX,
    all calls are recorded and stored as wav files on the server,
    how can i write an autodelete script to delete files when they reach 30 days old

    hope someone can help me :)
     
    Last edited: Jun 14, 2010
    Colbro1, Jun 14, 2010 IP
  2. FavouritesBlog

    FavouritesBlog Peon

    Messages:
    846
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try a PBX orientated forum, this is a web development forum.

    There are a few asterix forums out there
     
    FavouritesBlog, Jun 14, 2010 IP
  3. Colbro1

    Colbro1 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ok. Thanks
     
    Colbro1, Jun 15, 2010 IP
  4. madaboutlinux

    madaboutlinux Member

    Messages:
    250
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    43
    #4
    You can use the find command to list the files that are 30 days old and then pass it to rm -f command. The find command is

    find /path/to/wav/file/directory -type f -name *.wav -mtime +30 | xargs rm -f

    This will search any .wav files older than 30 days in the specified directory and will delete it from the server. You can write down this command in a file and execute the file on daily basis using a cronjob.
     
    madaboutlinux, Jun 15, 2010 IP