EDIT: This should be done in a script, not opening or editing via crontab -e
I have a list of cron jobs that already exists, below are some of them
*/30 * * * * /path/to/script.sh
0 12 * * * /path/to/script_2.sh
* * * * /path/to/script_3.sh
Scenario:
script_2.shis not found on some of the servers.- Need to add
>/dev/null 2>&1to all of this script
How can I do in Linux script to search for script_2.sh if that is already present in the crontab? If it is present in the crontab, >/dev/null 2>&1 should be appended. If it doesn't exist, it should be added to the jobs.