Skip to content

Running FediFetcher as a cron job

Michael edited this page Sep 10, 2024 · 6 revisions

Running FediFetcher as a cron job is in many ways the best way of running FediFetcher if you already have a linux device somewhere. This could be a your mastodon server, or another device (such as a Raspberry Pi).

Tu run FediFetcher as a cron job:

  1. Get an Access Token, if you haven't done so already
  2. Clone this repository.
  3. Install requirements: pip install -r requirements.txt
  4. Create a json file with your configuration options. You may wish to store this in the ./artifacts directory, as that directory is .gitignored
  5. Then simply run this script like so: python find_posts.py -c=./artifacts/config.json.

If desired, all configuration options can be provided as command line flags, instead of through a JSON file. An example script can be found in the examples folder.

When using a cronjob, we are using file based locking to avoid multiple overlapping executions of the script. The timeout period for the lock can be configured using lock-hours.

Tip

If you are running FediFetcher locally, my recommendation is to run it manually once, before turning on the cron job: The first run will be significantly slower than subsequent runs, and that will help you prevent overlapping during that first run.

Updating FediFetcher

It's important to stay up to with FediFetcher so you always get the latest features and bugfixes.

Please refer to the Updating FediFetcher documentation for more information.