31 lines
679 B
Bash
Executable File
31 lines
679 B
Bash
Executable File
#! /bin/bash
|
|
#touch /tmp/x.txt
|
|
|
|
# Check if programm LogRotate exists
|
|
if command -v logrotate >/dev/null;
|
|
then
|
|
echo "Program Logrotate exists. Continue..."
|
|
else
|
|
echo "Program Lognotate doen not exist. Start installation..."
|
|
apt-get install -y logrotate
|
|
fi
|
|
|
|
if [ ! -f /etc/logrotate.d/odoo ];
|
|
then
|
|
echo "Config-file for logrotation Odoo not found!"
|
|
|
|
#create config-file for Odoo Logrotation
|
|
cat <<EOF > /etc/logrotate.d/odoo
|
|
/var/log/odoo/*.log {
|
|
daily
|
|
missingok
|
|
rotate 7
|
|
compress
|
|
notifempty
|
|
}
|
|
EOF
|
|
echo "Created Odoo logrotation succesfully."
|
|
else
|
|
echo "Odoo logrotation allready exists."
|
|
fi
|