60,7 → 60,7 |
mkdir -p $DIR_TMP |
nb_files=`ls $DIR_LOG/firewall/tracability.log*.gz 2>/dev/null | wc -w` |
if [ $nb_files -ne 0 ]; then |
mv $(echo $(ls -rt $DIR_LOG/firewall/tracability.log*.gz | tail -n 1 -)) $DIR_TMP/tracability-HTTP.log-$NOW.gz |
mv $(echo $(ls -rt $DIR_LOG/firewall/tracability.log*.gz | tail -n 1 -)) $DIR_TMP/tracability-HTTP-$NOW.gz |
fi |
nb_files=`ls $DIR_BASE/radius-*.sql 2>/dev/null | wc -w` |
if [ $nb_files -ne 0 ]; then |
69,7 → 69,7 |
cd /var/log/nfsen/profiles-data/live/ipt_netflow |
nb_files=`find . -mtime -7 -name 'nfcapd.[0-9]*' | wc -l` |
if [ $nb_files -ne 0 ]; then |
find . -mtime -7 -name 'nfcapd.[0-9]*' | xargs tar -cf $DIR_TMP/tracability-ALL.log-$NOW.tar; |
find . -mtime -7 -name 'nfcapd.[0-9]*' | xargs tar -cf $DIR_TMP/tracability-ALL-$NOW.tar; |
fi |
cd /tmp/ |
nb_files=`ls archive-$NOW/* 2>/dev/null | wc -w` |
117,9 → 117,10 |
mkdir -p /tmp/live |
gap=$(($(date +%d)-1)) |
cd /var/log/nfsen/profiles-data/live/ipt_netflow |
find . -mtime -$gap -name 'nfcapd.[0-9]*' | xargs tar -cf /tmp/live/tracability.log-$NOW.tar; |
cp $(echo $(ls -rt $DIR_BASE/radius-*.sql | tail -n 1 -)) /tmp/live/ |
cp /var/log/firewall/tracability.log /tmp/live/ |
find . -mtime -$gap -name 'nfcapd.[0-9]*' | xargs tar -cf /tmp/live/tracability-ALL-$NOW.tar; |
/usr/local/sbin/alcasar-mysql.sh --dump |
mv $(echo $(ls -rt $DIR_BASE/radius-*.sql | tail -n 1 -)) /tmp/live/ |
cp /var/log/firewall/tracability.log /tmp/live/tracability-HTTP-$NOW.log |
tar -czf $DIR_ARCHIVE/tracability-$NOW.tar.gz /tmp/live/* |
rm -rf /tmp/live |
;; |