submitted 3 weeks ago* (last edited 3 weeks ago) by to c/programming@programming.dev
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] 4 points 3 weeks ago* (1 child)

This bit me so many times I have

# USE ABSOLUTE PATHS, ASSUME ALL COMMANDS ARE UNDEFINED, SPECIFY ALL VERSIONS, REDIRECT OUTPUT

at the top of my local crontab so I remember from when I take something from it to prod, lol.

Edit: formatting whoopsie

  • source
  • hideshow 2 child comments