OK... at the risk of exposing myself as a lame coder.... I've taken a shot at a bash script to start the ball rolling.

This script reads a file called cronIN.txt The file contains a list of commands you want executed. Each command is prefixed by a timestamp in the format YYYYmmddHHMM. The last of the file should contain "<end>".

As commands are executed they are removed from cronIN.txt and put in cronLOG.txt with a timestamp of when they ran.

I'm sure when you look at it you'll find ways of making it smaller. The end-of-file thing needs work and I'm sure some checking could be done up front to make sure the cronIN.txt file exists. The NICE command may have limits that I'm not aware of that would cause commands not to run. Like I said, it's a first shot. All improvements are welcome.

--------------======== Note =========The DSL Forum Search default is 'OR'If you search for "cat dog" you will get all "cat" posts and all "dog" posts. If you search for "cat AND dog" you will only find results that contain BOTH "cat" and "dog"Add '*' for wildcards, " cat* and dog* "

NewOld USer, I liked that example. It's more involved and gives more options than what I was thinking. I thought more of tasks that need to be run once or twice a day. I was more concerned with that than the task running exactly at 5:00 for example.

Here was my code to check every 5 minutes if the database has changed and if so, let the user know:

Code Sample

#!/bin/bash# an example of a timed action

OLD_MD5=`md5sum myfile`

while truedo sleep 5m # sleep for 5 minutes # could be 5s or 12h, # whatever you need if ! [ "$OLD_MD5" = "`md5sum myfile`" ] then # if the md5sum on the file has changed, back it up OLD_MD5=`md5sum myfile` # save the new sum echo $OLD_MD5 # display the fact we are changing # do backup stuff here fidone

Well.... in the light of day I see a problem with my version 0.01... It looks like it will miss the first entry in the cronIN.txt file. I've moved the reads around a little and came up with version 0.02

clacker, having it run at a certain time got me thinking about another project I want to do. I've been playing around with having mplayer record internet radio broadcasts. It would be nice to be able to have my server start recording at a certain time and day. When I get it working I'll post how it's done.

The other nice thing is that you can modify cronIN.txt with additional tasks and not have to change the script. Now if someone would build a nice Flua gui frontend to populate the cronIN.txt file.... maybe with a "repeat" slider that would create x number of entries. One for each day, week, month.... on a given task.

--------------======== Note =========The DSL Forum Search default is 'OR'If you search for "cat dog" you will get all "cat" posts and all "dog" posts. If you search for "cat AND dog" you will only find results that contain BOTH "cat" and "dog"Add '*' for wildcards, " cat* and dog* "