create cron job linux code example
Example 1: create cron job from command line
#write out current crontab
crontab -l > mycron
#echo new cron into cron file
echo "00 09 * * 1-5 echo hello" >> mycron
#install new cron file
crontab mycron
rm mycron
Example 2: add new cron job in linux
For editing the cron job file :
crontab -e
For listing all the running cron job
systemctl status cron ----OR---- crontab -l