Skip to content

Instantly share code, notes, and snippets.

@simov
simov / README.md
Last active June 26, 2025 15:07
Run `node` scripts using `nvm` and `crontab` without hardcoding the node version

Run node scripts using nvm and crontab without hardcoding the node version

cronjob.env.sh

#!/bin/bash

# NVM needs the ability to modify your current shell session's env vars,
# which is why it's a sourced function