Skip to content

Instantly share code, notes, and snippets.

@roramirez
Created June 14, 2016 18:08
Show Gist options
  • Save roramirez/18488847019add60a45f2c24b45fbf96 to your computer and use it in GitHub Desktop.
Save roramirez/18488847019add60a45f2c24b45fbf96 to your computer and use it in GitHub Desktop.
DATE=`date +%Y%m%d%H%M%S`
CSV_DIR=/var/log/asterisk/cdr-csv
CSV_FILE=$CSV_DIR/Master.csv
OWNER=asterisk
if [ -f $CSV_FILE ]; then
mv $CSV_FILE $CSV_DIR/cdr-$DATE.csv
touch $CSV_FILE
chown asterisk:asterisk $CSV_FILE
chmod +r $CSV_DIR/cdr-$DATE.csv
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment