Introduction
Cron jobs
Blobscan requires two periodic tasks in order to recalculate the metrics and block statistics.
There are multiple ways out there to run periodic jobs. You can simply use crontab for that:
crontab -e
Then add the following lines (adjust them to your case):
5 0 * * * cd $HOME/blobscan && pnpm job:daily >> $HOME/cron.log
*/15 * * * * cd $HOME/blobscan && pnpm job:overall >> $HOME/cron.log
Docker
When using docker, simply prefix pnpm with docker compose exec api
:
5 0 * * * cd $HOME/blobscan && docker compose exec api pnpm job:daily >> $HOME/cron.log
*/15 * * * * cd $HOME/blobscan && docker compose exec api pnpm job:overall >> $HOME/cron.log