Flarum CV One-Click Cleanup Shell Script

3,681 0

Tutorial

You need to create a new file and then add the content inside the code tag. Please replace yourdir with your forum's directory. I do not recommend running this script without NoJs. This will significantly increase the waiting time for the next visitor to your website.

Code

Bash
#!/bin/bash
echo "Clear Started!"
sleep 2
clear
cd /yourdir/assets
rm -f *.css
rm -f *.js
rm -f *.json
echo "Assets Cleared."
sleep 2
clear
cd /yourdir/storage/cache
rm -fr *
cd /yourdir/storage/less
rm -fr *
cd /yourdir/storage/views
rm -fr *
echo "Tmp Files Cleared."
sleep 2
clear
cd /yourdir
php flarum migrate
php flarum cache:clear
echo "PHP Files Reseted."
sleep 2
clear
echo "Clear Ended. Exit!"
sleep 2
clear
cat "/etc/motd"

Comments

(0)

No comments yet. Start the conversation.

Leave a comment

© 2026 Carefree. All rights reserved.

Carefree is a personal site about technology and everyday life, documenting web development, backend, and DevOps practices, plus software tools, digital experiences, and thoughts beyond code.