Archive monitor files

Discussion in 'General' started by asepulveda, Aug 20, 2009.

  1. asepulveda

    Joined:
    Jun 23, 2008
    Messages:
    400
    Likes Received:
    0
    how can i archive my monitor files? i want to store monitoring files in folders per month, and erase automaticaly all folders olders than 2 months, that way i will only have the last two months monitor files.

    thanks
     
  2. trymes

    Joined:
    Aug 19, 2009
    Messages:
    228
    Likes Received:
    0
    Check out this thread I started on FreePBX.org a while back. http://www.freepbx.org/forum/freepbx/us ... -recording

    The last post references a tool that should do what you are looking to do. (or at least part of it).

    Otherwise, your needs sound simple enough to perform with a shell script in the /etc/cron.monthly or /etc/cron.daily folder.

    Tom
     
  3. asepulveda

    Joined:
    Jun 23, 2008
    Messages:
    400
    Likes Received:
    0
    I already trie that software , but it dosent work very well.

    A cron may be the better idea, i will take a look in internet to get an idea of how to make it, any ideas?
     
  4. ramoncio

    Joined:
    May 12, 2010
    Messages:
    1,663
    Likes Received:
    0
    Hi Augusto,
    You can do a very simple script.

    With whis command you delete monitor files older than 30 days, it is a one-liner, but Fireboard is doing its funny things:
    Code:
    find /var/spool/asterisk/monitor -mtime +30 | xargs rm -rf
    
    Checkout "man find" there are some other time options you might find useful.


    With whis command you cleate a directory using the current date:
    Code:
    mkdir /var/spool/asterisk/monitor/`date +%Y.%m.%d`
    
    Checkout "man date" if you want to find some other options.
     
  5. asepulveda

    Joined:
    Jun 23, 2008
    Messages:
    400
    Likes Received:
    0
    Great Ramoncio!!!! Thanks for your help, let me try this, i let you know my results

    regards
     

Share This Page