On Fri, Nov 26, 2010 at 11:00 AM, David Collier <[email protected]> wrote: > Possibly a bad place to ask, but I'm trying to do stuff in busybox/ash > which involves time delays, or rather "alarms". > > I could do it with lots of little processes just sitting there going > "sleep 34600", but it isn't very elegant. > > One idea I have is to touch a file, but set it's date to say, 3 days in > the future. then use if[ ... -ot ] to trigger my action.
I have no idea what you mean by the above. > Can anyone tell me if there is anything around as standard that might > allow me to do the equivalent of > > touch /tmp/fred "+3days" plus3days=$(date '+%Y-%m-%d %H:%M:%S' -D '%s' -d $((`date '+%s'` + 3*24*60*60)) ) touch -d "$plus3days" FILE Note that date -D is a busybox extension. -- vda _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
