Linux Blog

Crontabs 101

Filed under: Shell Script Sundays — TheLinuxBlog.com at 11:42 pm on Sunday, January 4, 2009

Although not necessarily classified as shell scripting its self cron’s are very useful to any Linux administrators arsenal. The ability to run tasks at a specific interval is a great way to schedule things to run later or when the system load is lower. Many applications use crontab to schedule tasks so its hard to say what yours will look like.

crontab -l

will list all of the cron jobs scheduled for the currently logged in user mine has an entry for kpodder

# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
#KPodder entries
0 0 * * * kpodder.sh -c "/home/owen/.kde/share/apps/kpodder/" -s "global.casts" -o "/home/owen/podcasts" -d 0
#KPodder End

The first five fields are to tell the task when to run. They are in the following order: minute, hour, day, month, day of the week. Asterisks are used to say any valid value and a forward slash can be used to make intervals such as five minutes, hours, days or months (*/5). A comma can be used for or values, so if used as 2,4,6 the cron would run at 2, 4 or 6 o’clock. Dashes are used for time spans, If you have an 8-5 work day you can use 8-17 if in the hours field.

Next, the sixth field is the actual program to run. It will look in the $PATH for the user, but for safety’s sake, I try to use the full path if possible. In my example of the kpodder script there are many arguments. I only really use simple crons and the number of arguments here seems rather excessive.

To edit the crontab do crontab -e. This will edit the current users crontab. If you are root and wish to edit a naughty cron from another user you use -u and specify the user.

Thats pretty much all there is to it. I’d love to here tips and how much people love/hate cron and why.

Happy Shell Scripting New Year,

– Owen.

KDE 4.0 on Slackware 12

Filed under: General Linux — TheLinuxBlog.com at 12:34 am on Friday, January 18, 2008

It hasn’t been that long since the new KDE 4.0 has been released. To My surprise there is currently no working version of this available for Slackware 12. I have been searching around but haven’t been able to find any evidence of it working yet. In this case I’m going to try and get it working just to see if I can. In the mean time I may start up a new virtual machine and set up the Kubuntu live CD and maybe the Hardy Heron when it comes out. I’ve been watching the podcasts on You Tube but have mixed feelings about the new features, so I figure I’ll try it out myself rather than relying on other peoples opinions and videos. I suggest every one do the same thing.

I know this is old but it is one of the videos from the KDE commit digest. The containment feature seems like a pretty neat feature. What do you think?


http://www.youtube.com/watch?v=HGYGzTDHhPg