I have been wondering what the best way is, on FreeBSD (in the base system), to schedule a task that will be executed one time only at a particular time in the future, for a regular user. I have been using a regular-user crontab to periodically check email, running an alarm clock, etc. By default, FreeBSD doesn't allow a normal user to run at(1); even if at(1) was enabled, by default it would only be executed every 5 minutes, by cron(8). So it seems that FreeBSD really wants to discourage the use of at(1). Without at(1), it seems that one's best bet, as a regular user, would be to use crontab(1). However, it one wishes to schedule a periodic task, then it is reasonable to use
crontab -e
every time to interactively edit the crontab file. If one wishes only to schedule a one-time-only task, then crontab -e
suddenly seems very excessive, not to mention, for the sake of cleanness, one needs to remove the crontab item for that particular task afterwards. My impression is that by default, FreeBSD doesn't provide an easy way to schedule one-time-only tasks for a regular user, other than the 'not-recommended' at(1). I know that tcsh provides a built-in sched(1), but it seems to need the parent shell present all the time, which is not very convenient. I could of course write a wrapping script to implement such a scheduler using crontab(1) itself, but I can't help but wondering whether I am missing something obvious. What do you think is the best way to schedule one-time-only tasks for regular users in the base system (taking system security into consideration of course)?