Fixup CDRC to only log on errors but not stop the server, adding freeswitch rotate cdrs script

This commit is contained in:
DanB
2014-01-12 19:56:27 +01:00
parent 43c097aa98
commit 91bae964ba
2 changed files with 13 additions and 1 deletions

View File

@@ -152,7 +152,7 @@ func (self *Cdrc) trackCDRFiles() (err error) {
case ev := <-watcher.Event:
if ev.IsCreate() && (self.cgrCfg.CdrcCdrType != FS_CSV || path.Ext(ev.Name) != ".csv") {
if err = self.processFile(ev.Name); err != nil {
return err
engine.Logger.Err(fmt.Sprintf("Processing file %s, error: %s", ev.Name, err.Error()))
}
}
case err := <-watcher.Error:

View File

@@ -0,0 +1,12 @@
#! /usr/bin/env sh
FS_CDR_CSV_DIR=/var/log/freeswitch/cdr-csv
CGR_CDRC_IN_DIR=/var/log/cgrates/cdr/in/csv
/usr/bin/fs_cli -x "cdr_csv rotate"
find $FS_CDR_CSV_DIR -maxdepth 1 -mindepth 1 -not -name *.csv -print0 | xargs -0 mv -t $CGR_CDRC_IN_DIR
exit 0