LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-07-2007, 09:30 AM   #1
Harpo
Member
 
Registered: Mar 2006
Location: Canada
Distribution: Suse 10.0 Retail, 10.1, 10.2, 11.1, Edubuntu 7.04, Mandriva 2010
Posts: 89

Rep: Reputation: 15
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
 
Old 01-07-2007, 09:37 AM   #2
avallach
Member
 
Registered: Sep 2006
Location: Silesia
Distribution: Debian GNU/Linux 4.0, ArchLinux, OpenBSD
Posts: 190
Blog Entries: 2

Rep: Reputation: 30
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.

Last edited by avallach; 01-07-2007 at 09:45 AM.
 
Old 01-07-2007, 09:38 AM   #3
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,498

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
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).
 
Old 01-07-2007, 09:39 AM   #4
FnordPerfect
Member
 
Registered: Dec 2006
Location: Germany
Distribution: Kubuntu (Feisty Fawn), Debian (SID)
Posts: 127

Rep: Reputation: 15
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
 
Old 01-07-2007, 01:36 PM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
argh. Deleted. Just repeating other posters.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alt-tab Task switch replacements, know of any? nova_ Linux - Software 1 12-03-2006 01:17 AM
help in cron tab framedrelay Programming 1 11-15-2006 07:49 AM
cron tab, what do you use it for? Fritz_Monroe Linux - Newbie 12 09-28-2006 02:54 PM
cron tab thefedexguy Suse/Novell 4 07-06-2006 11:03 AM
[cron][mdk9.1]cron deamon seems to ignore some task... yannrichet Linux - Newbie 5 06-26-2003 09:57 AM


All times are GMT -5. The time now is 08:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration