Contribute  :  Calendar  :  Advanced Search  :  Site Statistics  :  Directory  :  Contact Us  :  Mailing List  :  Web Resources  :  Polls  :  My Downloads  :  Media Gallery  
    Highland Lakes Linux User Group Bringing GNU/Linux and F/OSS to the Highland Lakes    
 Welcome to Highland Lakes Linux User Group
 Sunday, May 11 2008 @ 07:41 PM MDT

Using cron to schedule events!

   
Linux TipsMy daughter no longer has a TV in her room and is instead watching cable
TV on her computer which has a nice, new to her, 19" Monitor (thanks to
Don!). Anyway, she likes to watch TV before going to sleep but likes to
set the TV to go off at a preset time. However, The TV application on
Linux, "tvtime", does not have a specific sleep shutoff time setting in
the software.

So, I thought I would try to use cron to turn off "tvtime" for here at a
preset time and maybe find a way for her to change the "quit" time via a
gui application. I found two (2) gui applications for cron; gcontab and
kCron. kCron is the nicer application and easier to use. So I installed
kCron on her Ubuntu 7.10 machine and created a script named "tvstop.sh"
and put it in her home directory (/home/kristeen/bin).

"/home/kristeen/bin/tvstop.sh" contains a single line:
tvtime-command QUIT

Then just make the script executable:
$ chmod +x tvtime.sh

In kCron you just add a "task" and set the time you want it to run.
kCron will install a user crontab file in "/var/spool/cron/crontabs", In
this case it was named "kristeen" and the job is scheduled to run at
11:30 PM every night.

root@kpcomix:/var/spool/cron/crontabs# cat kristeen
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/kde-kristeen/kcron5Xxbvc.tmp installed on Thu Nov 15 20:42:38 2007)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
#
30 23 * * * /home/kristeen/bin/tvstop.sh
# This file was written by KCron. Copyright (c) 1999, Gary Meyer
# Although KCron supports most crontab formats, use care when editing.
# Note: Lines beginning with "#" indicates a disabled task.

Cron is very powerful and can be harnessed to do some good things to
make your life a little more enjoyable!

Hey Linux and related friends does amazing things again!
 

What's Related

Story Options

Using cron to schedule events! | 0 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
 Copyright © 2008 Highland Lakes Linux User Group
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.20 seconds