LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How To Create A Cron Tab/Task? (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-a-cron-tab-task-517131/)

Harpo 01-07-2007 10:30 AM

How To Create A Cron Tab/Task?
 
Hello

I was looking to automate a backup script that I have made. I want to have Cron run it for me. I understand that there should be a user tab in /var/spool/cron/tabs. However, when I went there there was no tab for me there. I then created my own tab and put my script in the newly created tab. Will this work, or am I missing a step that is required?

I am running Suse 10.0 with KDE 3.5. Any help offered is greatly appreciated.

Thanks
Harpo
:newbie:

avallach 01-07-2007 10:37 AM

Personally I'm always using
Code:

crontab -e
. It runs an editor in which I can set the task and how often to run it. I think this is the best way.

colucix 01-07-2007 10:38 AM

You have to manage your crontab with the command
Code:

crontab -e
this open a vi session which let you create your own crontab. See man crontab for more details and other useful options. The environment variable EDITOR control the program used for editing (vi as default).

FnordPerfect 01-07-2007 10:39 AM

You don't need to mess around in /var/spool for that.
Either you type crontab -e in a terminal which launches an available text editor (your favourite text editor as defined in the EDITOR shell variable, or when you're unlucky: vi ;-)
however, the crontab is in a special format, that means the time and date when a specific task is run must to be put in there in a special order:
1st column: minute of the hour
2nd column: hour of the day
3rd column: day of month
4th column: month
5th column: day of week
and finally 6th column: the command you want to run.

it is very flexible, but also not easy to grasp on first sight. for example, you can also define "slices" of time. If the first column is for example 59/3 then the command would be launched every 3 minutes.
Just have a look at the manpage.

KDE also has a frontend available, it is called kcron

anomie 01-07-2007 02:36 PM

argh. Deleted. Just repeating other posters.


All times are GMT -5. The time now is 12:23 PM.