Edit: I use Debian stable 9.3.
I have the following code which is aimed to run inside root's crontab:
0 0 * * * /opt/cron_daily.sh 0 0 * * 0 /opt/cron.weekly.sh
Of course I can manually copy it, then execute
crontab -e, then pasting it in the end of the file, but what if I want to insert/inject/print this code into the root's crontab from a command instead?
Is it possible with an heredocument or some other technique?
Note: I must use
crontab and not
/etc/cron which as I know, are two different things.
If it matters somehow, I load the two cron scripts daily_cron.sh and weekly_cron.sh from heredocuments in Github (I copy them and paste and execute them directly in terminal).
Please show how to inject each script to daily and weekly crontabs.