I wrote a little script which uses tootctl to remove media files:
mastodon@s3:~$ cat media_remove.sh #!/bin/bash cd /home/mastodon/live RAILS_ENV=production bin/tootctl media remove > log/media_remove.log 2>&1
When I run that script as user mastodon from the command line, it works fine. However, I wanted to run it as a cron job every night:
mastodon@s3:~$ crontab -l 0 5 * * * /home/mastodon/media_remove.sh
Unfortunally, that doesn’t work. My log file says:
mastodon@s3:~$ cat live/log/media_remove.log /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- bundler/setup (LoadError) from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' from /home/mastodon/live/config/boot.rb:3:in `<top (required)>' from bin/tootctl:3:in `require_relative' from bin/tootctl:3:in `<main>'
I don’t know, what that error means and how to fix it. Can someone help me with that?
Thanks and kind regards