Deployed a backup script on a new server, tested it manually — worked fine. Set up crontab, came back next morning, no backup. Turns out /usr/local/bin wasn’t in cron’s PATH so pg_dump just silently didn’t exist.

Switched to absolute path and it worked immediately. Fifteen minutes of debugging for a one-character fix. I keep making this mistake every time I set up a new box. At this point I should just have a checklist taped to my monitor.

  • folekaule@lemmy.world
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    2 hours ago

    Or maybe even set up a valid MAILTO in the crontab so that failures are emailed to them.

    My “pro” tips:

    • set up an email alias from root to an email you actually read
    • always use absolute paths
    • anything complex, put it in a shell script