Here’s a neat command to append a job to a crontab within a Bash script.

<pre lang="bash">
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.

<pre lang="bash">
crontab -l