diff --git a/src/freedombone b/src/freedombone index 7e12dd0e..cec4c928 100755 --- a/src/freedombone +++ b/src/freedombone @@ -8572,6 +8572,15 @@ function install_gnu_social { fi echo "GNU Social onion domain:${MICROBLOG_ONION_HOSTNAME}" >> $COMPLETION_FILE + # clear down the database periodically + echo '$n = new Notice();' > /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/clear-database.php + echo "\$n->whereAdd('created < NOW() - INTERVAL 1 YEAR');" >> /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/clear-database.php + echo 'if ($n->find()) { while ($n->fetch()) { $n->deleteAs($n->getProfile()); } }' >> /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/clear-database.php + echo 'exit' >> /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/clear-database.php + echo '#!/bin/bash' > /etc/cron.weekly/clear-microblog-database + echo "cat /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/clear-database.php | php /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/scripts/console.php" >> /etc/cron.weekly/clear-microblog-database + chmod +x /etc/cron.weekly/clear-microblog-database + # some post-install instructions for the user if ! grep -q $"Microblog administrator" /home/$MY_USERNAME/README; then echo '' >> /home/$MY_USERNAME/README