Repeat at random intervals
I'm trying to come up with a way to repeat things at random intervals. I think I need to use "at" and call an executable file that terminates by placing a new "at" command.
I have a collection of "cute" sounds and I want my box to interesting little noises at odd, infrequent intervals. This is what I've come up with so far -- creating a file something like this: - - - - - - - - - - - - - - - # filename: cute_sounds.txt # repeats a selected sound at random interval # as shown, repeats from 1 to 30 days from "now" # replace "some_cute_sound_file.wav" with the name of the # sound file to be played play some_cute_sound_file.wav at now * (1 + (int) (30.0 * (rand() / (RAND_MAX + 1.0)))) days cute_sounds.txt - - - - - - - - - - - - - - - Has anyone done something like this before? Any ideas or tips to help me along the way? - Bill |
Quote:
|
Quote:
Can at commands be filed to run after logout? Can they be set to run after login if the set time was missed due to the user being logged out? (Would it be useful to have the command entered as root?) - Bill |
If you're worried about the command running after reboot, add it to your startup scripts! I don't know Fedora's methodology off the top of my head, but I'm pretty sure they still use rc.local -- this is where you can put custom startup scripts; anything therein is run just before the first login prompt is displayed.
|
Quote:
|
All times are GMT -5. The time now is 02:10 AM. |