- Notifications
You must be signed in to change notification settings - Fork88
Description
I'd like to process the output of cronnext using tools likeyq. The output that cronnext gives is mostly YAML-like, but not entirely so.
This crontab line:
15 17 * * * echo "Out of my brain on the train" > /tmp/foo.loggets printed by cronnext as:
next: 1726006500nextjobs: - user: alester cmd: "echo "Out of my brain on the train" > /tmp/foo.log" flags: 0x0C flagnames: DOM_STAR|DOW_STAR delay: 0 next: 1726006500 nextstring: Tue Sep 10 17:15:00 2024but a tool likeyq can't parse that because the double quotes in the cmd: value aren't escaped. It would be fine if it was:
next:1726006500nextjobs: -user:alestercmd:"echo\"Out of my brain on the train\" > /tmp/foo.log"flags:0x0Cflagnames:DOM_STAR|DOW_STARdelay:0next:1726006500nextstring:Tue Sep 10 17:15:00 2024
I understand that nowhere doescronnext say that its output is YAML, and it would be great if it could be made so. If you didn't want to change the output because existing tools that use the output could break, an optional--yaml option to make the strict YAML format output would work, too.
I don't know what other things might have to change in the output to be correct YAML. I know there are a bunch of special characters and sequences that need to be escaped, but I don't know the full list. I figure there are plenty of libraries out there to do the dirty work.