View Single Post
Old 09. Dec 2009, 04:40 AM   #4 (permalink)
debtboy
Senior Member
 
debtboy's Avatar
 
Join Date: May 2009
Location: ~/
Posts: 128
Default

Anacron needs very little explanation, you have 4 folders:

cron.hourly
cron.daily
cron.weekly
cron.monthly




As the root user or sudo, drop your executable script into the desired folder and that job will be executed
as close to the interval as possible when the computer is running.

To make your script(s) executable, add a she-bang #!/bin/bash as the first line in your script and then enter your commands.
The executable bit(s) should be set after the file is saved via the chmod command.
For example... script1.sh

Code:
#!/bin/bash
date >> /home/debtboy/log1.txt
save it as script1.sh
now enter chmod 755 ./script1.sh
755 = (rwxr_xr_x)
now drop it in the folder of choice.

These were a few cron/crontab/anacron basics via the command line,
but there are graphical interfaces for those who prefer them as well as tasking programs on your favourite desktop environments.

Give cron a try if your not using it already.


That's all there is to it!!
No need to schedule as the folder names speak for themselves.
__________________
[I][B]Linux, the choice of a GNU generation[/B][/I]
debtboy is offline   Reply With Quote