How to use crond instead of atd?

Go To StackoverFlow.com

0

I have an embedded device running busybox. The device has crond installed and running, but has no atd daemon. I need to schedule task to run at a given time (just once, not periodically). I know, that the "kosher" way is to use at command, but I unfortunately don't have one. So, how can I use cron as a workaround?

2012-04-05 15:54
by zserge


1

You can set up the cron to run your script, and when it succeeds, the script should just comment out or remove the cron entry.

2012-04-05 16:10
by johnshen64
Assume the script is scheduled at 12:15 and 12:30. There will be two cron entries, right? And script should detect which one it was called from (by current time?) and comment that one, leaving another for the second launch. Am I right, as it seems somewhat complicated to me - zserge 2012-04-05 17:40
if you need to run the script twice, then your approach should work, but your script could just wait until the time is greater than 12:30 to comment out both entries. likely the easiest is to use sed -i on the actual cron file in /var/spool/cron or whatever your system stores the cron file. or simply do a crontab -r to remove the entire cron file, if these are your only entries - johnshen64 2012-04-05 17:44
Ads