Update mastodon.sh

adding required lines for running the script as a cronjob
This commit is contained in:
daniel committed 2026-10-15 05:11:36 +00:00
1 parent ee582233fd
commit c835954f5d
1 file changed
+9
+9
View File
@@ -1,11 +1,20 @@
#!/bin/bash #!/bin/bash
#written by Daniel Wenzlik 2024 - https://danielwenzlik.com #written by Daniel Wenzlik 2024 - https://danielwenzlik.com
#modified by Daniel Wenzlik 2026 - https://danielwenzlik.com
#Script under the GNU AGPLv3 license. #Script under the GNU AGPLv3 license.
# making rbenv/Ruby accessible for the user/script
export HOME="/home/mastodon"
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:/usr/local/bin:/usr/bin:/bin"
# initialise rbenv
eval "$("$HOME/.rbenv/bin/rbenv" init - bash)"
#using the correct directory #using the correct directory
echo "Navigating to the Mastodon Directory now"; echo "Navigating to the Mastodon Directory now";
cd /home/mastodon/live/; cd /home/mastodon/live/;
export RAILS_ENV=production
#deleting cache files #deleting cache files
echo "Clearing cache"; echo "Clearing cache";