Subversion Repositories ALCASAR

Rev

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

Rev 1827 Rev 1909
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-archive.sh 1827 2016-04-19 09:47:29Z raphael.pion $
2
# $Id: alcasar-archive.sh 1909 2016-05-24 08:38:21Z raphael.pion $
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 121... Line 121...
121
		chown root:apache $DIR_ARCHIVE/*
121
		chown root:apache $DIR_ARCHIVE/*
122
		;;
122
		;;
123
	--live | -l)
123
	--live | -l)
124
		mkdir -p $DIR_ARCHIVE
124
		mkdir -p $DIR_ARCHIVE
125
		mkdir -p /tmp/live 
125
		mkdir -p /tmp/live 
126
		gap=$(($(date +%e)-1))
126
		gap=7
127
		cd /var/log/nfsen/profiles-data/live/alcasar_netflow
127
		cd /var/log/nfsen/profiles-data/live/alcasar_netflow
128
		find .  -mtime -$gap -name 'nfcapd.[0-9]*' | xargs tar -cf /tmp/live/traceability-ALL-$NOW.tar;
128
		find .  -mtime -$gap -name 'nfcapd.[0-9]*' | xargs tar -cf /tmp/live/traceability-ALL-$NOW.tar;
129
# Saving of the database
129
# Saving of the database
130
		/usr/local/bin/alcasar-mysql.sh --dump
130
		/usr/local/bin/alcasar-mysql.sh --dump
131
		mv $(echo $(ls -rt $DIR_BASE/alcasar-users-database-*.sql.gz | tail -n 1 -)) /tmp/live/
131
		mv $(echo $(ls -rt $DIR_BASE/alcasar-users-database-*.sql.gz | tail -n 1 -)) /tmp/live/