Fail2ban log; Rsync flow
This commit is contained in:
27
main.sh
27
main.sh
@@ -52,27 +52,36 @@ if [ "$log_backup" = true ] then
|
||||
mkdir -p $tmpdir/syslogs
|
||||
cp /var/log/syslog $tmpdir/syslogs/
|
||||
cp /var/log/message $tmpdir/syslogs/
|
||||
|
||||
if [ "$fail2ban_log" = true ] then
|
||||
cp /var/log/fail2ban.log $tmpdir/syslogs/
|
||||
fi
|
||||
|
||||
if [ "$log_backup_web" = true] then
|
||||
if [ "$apache" = true ] then
|
||||
mkdir -p $tmpdir/apachelogs
|
||||
cp -r /var/log/httpd $tmpdir/apachelogs
|
||||
mkdir -p $tmpdir/apachelogs
|
||||
cp -r /var/log/httpd $tmpdir/apachelogs
|
||||
fi
|
||||
if [ "$nginx" = true ] then
|
||||
mkdir -p $tmpdir/nginxlogs
|
||||
cp -r /var/log/nginx $tmpdir/nginxlogs
|
||||
mkdir -p $tmpdir/nginxlogs
|
||||
cp -r /var/log/nginx $tmpdir/nginxlogs
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$log_purge" = true] then
|
||||
echo "Purging logs..." >&2
|
||||
truncate -s 0 /var/log/syslog
|
||||
truncate -s 0 /var/log/message
|
||||
if [ "$apache" = true ] then
|
||||
# TODO: removal for .1.2.3 logs
|
||||
truncate -s 0 /var/log/httpd/*
|
||||
# TODO: removal for .1.2.3 logs
|
||||
truncate -s 0 /var/log/httpd/*
|
||||
fi
|
||||
if [ "$nginx" = true ] then
|
||||
# TODO: removal for .1.2.3 logs
|
||||
truncate -s 0 /var/log/nginx/*
|
||||
# TODO: removal for .1.2.3 logs
|
||||
truncate -s 0 /var/log/nginx/*
|
||||
fi
|
||||
if [ "$fail2ban_log" = true ] then
|
||||
truncate -s 0 /var/log/fail2ban.log
|
||||
fi
|
||||
fi
|
||||
echo "Finished" >&2
|
||||
@@ -81,7 +90,7 @@ fi
|
||||
|
||||
function push {
|
||||
if [ "rsync_push" = true ] then
|
||||
#Push
|
||||
#Push - Dockerized
|
||||
if [ "push_clean" = true ] then
|
||||
rm /opt/backify-$timestamp.tar.gz
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user