Here’s a neat command to append a job to a crontab within a Bash script.
crontab -l | { cat; echo "0 1 * * * /dir/script.sh > /logs/script.cronlog 2>&1"; } | crontab - |
To validate, perform crontab -l to see if your changes are there.
crontab -l |
cloud engineer
Here’s a neat command to append a job to a crontab within a Bash script.
crontab -l | { cat; echo "0 1 * * * /dir/script.sh > /logs/script.cronlog 2>&1"; } | crontab - |
crontab -l | { cat; echo "0 1 * * * /dir/script.sh > /logs/script.cronlog 2>&1"; } | crontab -
To validate, perform crontab -l to see if your changes are there.
crontab -l |
crontab -l