How can I check cron syntax on a script like "crontab -e"?
2 answers
Crontab with the -e option opens the default editor with the current cron file and installs it upon exit.
First of all, save your actual cron file so you don't lose or break anything.
crontab -l > backup.cron
You can directly install the file you prepared:
crontab yourFile.text
Or use a pipe in your script:
#/bin/bash
Variable="your scheduled tasks"
echo $Variable | crontab
You will receive error messages in case of bad formatting.
More information: man crontab
+4
source to share