FediFetcher/docs/cron-job.md
2024-09-09 11:04:30 +01:00

1.3 KiB

Running FediFetcher as a cron job

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. Clone this repository.
  2. Install requirements: pip install -r requirements.txt
  3. Create a json file with your configuration options. You may wish to store this in the ./artifacts directory, as that directory is .gitignored
  4. 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.

For other options of running FediFetcher see the README file.