Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1357 → Rev 1358

/scripts/alcasar-archive.sh
58,9 → 58,9
function archive() {
mkdir -p $DIR_ARCHIVE
mkdir -p $DIR_TMP
nb_files=`ls $DIR_LOG/firewall/tracability.log*.gz 2>/dev/null | wc -w`
nb_files=`ls $DIR_LOG/firewall/traceability.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-$NOW.gz
mv $(echo $(ls -rt $DIR_LOG/firewall/traceability.log*.gz | tail -n 1 -)) $DIR_TMP/traceability-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-$NOW.tar;
find . -mtime -7 -name 'nfcapd.[0-9]*' | xargs tar -cf $DIR_TMP/traceability-ALL-$NOW.tar;
fi
cd /tmp/
nb_files=`ls archive-$NOW/* 2>/dev/null | wc -w`
118,11 → 118,11
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-ALL-$NOW.tar;
find . -mtime -$gap -name 'nfcapd.[0-9]*' | xargs tar -cf /tmp/live/traceability-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/*
cp /var/log/firewall/traceability.log /tmp/live/traceability-HTTP-$NOW.log
tar -czf $DIR_ARCHIVE/traceability-$NOW.tar.gz /tmp/live/*
rm -rf /tmp/live
;;
*)