Skip to content

Release 33.16

Latest

Choose a tag to compare

@github-actions github-actions released this 08 Nov 06:31
b5e7bac

What's new

cronitor sync --auto no longer installs an empty crontab when the API fails

Fixes for 33.15 (#93):

  • With --auto and a single crontab file, if the Cronitor API call fails, sync now prints the original crontab to stdout, leaves the file unchanged, and exits 1. Before, it printed nothing, so cronitor sync --auto file | crontab - installed an empty crontab.
  • The same applies once sync has read the file and then hits a missing API key, an invalid --format, or a file it can't write. It prints the original crontab and exits 1.
  • A crontab file that is missing or can't be read now exits 1, with the error on stderr and nothing on stdout. Before, it exited 0. --dry-run on a single named file that can't be written also exits 1.
  • --verbose request logs go to stderr when stdout carries the crontab, so they can't end up in the pipe.
  • With several crontabs, or in interactive mode, an API failure no longer stops the run. Each remaining crontab is still tried, and sync exits 1 at the end.
  • A direct | crontab - pipe can still install an empty crontab if sync fails before it reads the file, for example when the file is missing or a flag is invalid. Capture the output first: out=$(cronitor sync --auto file) && printf '%s\n' "$out" | crontab -. Don't add --silent to that command, because --auto --silent prints no crontab.

Other changes

  • The reminder after an interactive dry run now tells you to run the same command without --dry-run. Before, it suggested --auto --silent. API keys passed with -k/--api-key or -p/--ping-api-key are hidden in that reminder.