hi,
how can I add a new value to crontab file using a script not using the command " crontab -e " .
ex:
echo " 10 10 * * * " >> /var/spoll/cron/crontabs/<username>
how can I do that in a correct way??
thanks,
hi,
how can I add a new value to crontab file using a script not using the command " crontab -e " .
ex:
echo " 10 10 * * * " >> /var/spoll/cron/crontabs/<username>
how can I do that in a correct way??
thanks,
The above is what I would do, which is the simplest method. I don't understand what you're looking for...
You can also use the crontab -l a nd redirect to a temp file. Use vi to make your change and then resubmit the file to the cron
e.g.
crontab -l > /var/tmp/root.txt
vi /var/tmp/root.txt
crontab root.txt
hydrashok128 approach is good. Personally I would copy the crontab twice under different names to preserve the original if the edit goes wrong. Always post the crontab with a "crontab" command because this validates the file.
Adding a line to crontab can be scripted by this approach.