scripting crontab entries

Peter Risdon peter at
Wed Feb 16 09:40:56 GMT 2005

I want to be able to update a user's crontab from a script. tabs
in /var/cron/tabs carry a warning that the file should not be edited
directly, so presumably something like

#echo "5 * * * *   /some/" >> /var/cron/tabs/$USER

is the wrong approach. Is the right approach:

#cat ~/.mycrontab
5 * * * *   /some/

#crontab ~/.mycrontab

The right way to go? I notice this approach blows away existing crontab
entries, and was hoping to be able to append new ones instead, but then
by treating ~/.mycrontab as the master file, I can manage this OK.



More information about the freebsd-questions mailing list