Programming and Scripting :: scheduling a task
I'm a little new to DSL/Linux but the other distros I've used before had 'cron' or 'at' to schedule a task/script to be run. I don't see that with DSL. I'm running a frugal install with JWM desktop, is there some function in the DSL frugal install or the JWM desktop that I could use to trigger a script to be run at a set time and date?
I've read that some users have done an apt-get to install cron but I didn't think that would work with a frugal install. Am I wrong?
The other thing I was thinking about was creating (if I had any idea how to do it) a script that uses a SQLite database and 'wakes up' every five minutes to see if something needs to be launched. Does anyone have this script in their backpocket? Might be a nice, small addition to the DSL base system.
You can install applications into frugal with apt-get or dpkg, but you will need to reinstall them every time your reboot.
One thing to be careful with when using apt-get is that it will often take liberties with the support files it wants to install. Since these packages were built specifically for the more fully-stocked Debian, they may require certain versions of some libraries and other programs that are not available in DSL. In contrast, myDSL packages are made to work with what DSL already has as much as possible. If they are compiled specifically for DSL they may be compiled to work with DSL-specific libraries, and sometimes have features disabled in order to prevent the need to add more software.
could this be done with a bash script?
not sure how a bash script could do it.... what would you do? read a text file with Time and Task information? Maybe with flua, don't really know what functions flua has available. I guess DSL does come with a 'Calendar' utility, maybe it could be modified ( a lot ) or used as a starting point. What's that SQLite book app written in?
I never thought much about scheduled tasks but I can see how it would be nice to have it available. Actually I thought DSL had something like 'cron' or 'at' in it already.
What's available as a UCI ? I think there is Python and Tcl. They're not native to DSL but a UCI is pretty light on resources and Python and Tcl are robust languages.
What would it really need to do?
1. Read a list of dates and tasks
2. Determine if any tasks with a date/time less then the current date/time have not yet been executed.
3. Execute the task
4. mark it as done, so you have an audit trail.
5. go back to #2
6. if no tasks remain go to sleep for a while.
If you want to get fancy:
- add a 4.5 step to create the 'next task' in a recurring tasks ( the every day at 3 am type of tasks ).
- make the list of times and tasks a sqlite table
- create a webpage or some gui interface to enter and view the task list
Sorry, not much help, but the more I think about this, the more I think it could be useful. Of course maybe it's as easy as pie to install cron and this would just be an exercise in twidling with electrons.
Good luck. Have you done any internet searches looking for scripts?
If you are running a frugal w/ persistant home directory I believe the crontab would be in /home/dsl/etc/crontab I believe
Brian
AwPhuch
Next Page...
original here.