Subversion Repositories ALCASAR

Rev

Rev 1400 | Rev 1583 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1400 Rev 1564
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-archive.sh 1400 2014-07-02 07:07:20Z richard $
2
# $Id: alcasar-archive.sh 1564 2015-02-09 23:18:36Z richard $
3
 
3
 
4
# alcasar-archive.sh
4
# alcasar-archive.sh
5
# by Franck BOUIJOUX and REXY
5
# by Franck BOUIJOUX and REXY
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 114... Line 114...
114
		chown root:apache $DIR_ARCHIVE/*
114
		chown root:apache $DIR_ARCHIVE/*
115
		;;
115
		;;
116
	--live | -l)
116
	--live | -l)
117
		mkdir -p $DIR_ARCHIVE
117
		mkdir -p $DIR_ARCHIVE
118
		mkdir -p /tmp/live 
118
		mkdir -p /tmp/live 
119
		gap=$(($(date +%d)-1))
119
		gap=$(($(date +%e)-1))
120
		cd /var/log/nfsen/profiles-data/live/alcasar_netflow
120
		cd /var/log/nfsen/profiles-data/live/alcasar_netflow
121
		find .  -mtime -$gap -name 'nfcapd.[0-9]*' | xargs tar -cf /tmp/live/traceability-ALL-$NOW.tar;
121
		find .  -mtime -$gap -name 'nfcapd.[0-9]*' | xargs tar -cf /tmp/live/traceability-ALL-$NOW.tar;
122
		/usr/local/sbin/alcasar-mysql.sh --dump
122
		/usr/local/sbin/alcasar-mysql.sh --dump
123
		mv $(echo $(ls -rt $DIR_BASE/radius-*.sql | tail -n 1 -)) /tmp/live/
123
		mv $(echo $(ls -rt $DIR_BASE/radius-*.sql | tail -n 1 -)) /tmp/live/
124
		cp /var/log/firewall/traceability.log /tmp/live/traceability-HTTP-$NOW.log
124
		cp /var/log/firewall/traceability.log /tmp/live/traceability-HTTP-$NOW.log