#!/bin/bash . /usr/src/m2/framework/bash_functions.sh src="/usr/src/m2/mysql/partitions" cd $src || exit 1 cp -f partitions_delete.sh /usr/local/m2 # now handled by m2_global_logrotate #add_logrotate_if_not_present "/var/log/m2/m2_partitions_delete.log" "m2_partitions_delete" "7" # Cron commented out for now if ! [[ -e /etc/cron.d/m2_partitions_delete ]]; then echo "#30 4 * * * root /usr/local/m2/partitions_delete.sh EXECUTE >> /var/log/m2/m2_partitions_delete.log 2>&1" > /etc/cron.d/m2_partitions_delete fi chmod 0644 /etc/cron.d/m2_partitions_delete service crond restart > /dev/null grep -Fq 'delete_partitions_older_than_days' /etc/m2/system.conf || { echo ""; echo "delete_partitions_older_than_days = 0"; } >> /etc/m2/system.conf grep -Fq 'delete_calls_old_partitions_older_than_days' /etc/m2/system.conf || { echo "delete_calls_old_partitions_older_than_days = 0"; } >> /etc/m2/system.conf report "partitions_delete.sh script has been installed" 0