Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1246 → Rev 1247

/scripts/alcasar-log.sh
File deleted
Property changes:
Deleted: svn:eol-style
-LF
\ No newline at end of property
Deleted: svn:executable
-*
\ No newline at end of property
Deleted: svn:keywords
-Id Author Date
\ No newline at end of property
/scripts/alcasar-archive.sh
54,10 → 54,13
 
function archive() {
mkdir -p $DIR_ARCHIVE
mkdir -p $DIR_TMP
cp $(echo $(ls -rt $DIR_LOG/firewall/tracability.log*.gz | tail -n 1 -)) $DIR_TMP/
cp $(echo $(ls -rt $DIR_BASE/radius-*.sql | tail -n 1 -)) $DIR_TMP/
tar cvzf /tmp/$FILE $DIR_TMP/*
mkdir -p $DIR_TMP
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_BASE/radius-*.sql | tail -n 1 -)) $DIR_TMP/
cd /var/log/nfsen/profiles-data/live/ipt_netflow
find . -mtime 0 -mtime -7 -name 'nfcapd.[0-9]*' | xargs tar -cf $DIR_TMP/tracability-ALL.log-$NOW.tar;
cd /tmp/
tar cvzf /tmp/$FILE archive-$NOW/*
} # end archive
 
# Core script
92,6 → 95,16
rm -rf /tmp/archive-*
chown root:apache $DIR_ARCHIVE/*
;;
--live | -l)
mkdir -p /tmp/live
gap=$(($(date +%d)-1))
cd /var/log/nfsen/profiles-data/live/ipt_netflow
find . -mtime 0 -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/
tar -czf $DIR_ARCHIVE/tracability-$NOW.tar.gz /tmp/live/*
rm -rf /tmp/live
;;
--update | -u)
# Mise à niveau de l'architecture d'export/archivage
[ -d /tmp/save ] || mkdir -p /tmp/save