Before you blow me off, let me say that I've been using Linux for about six months and this is the first time I've had occasion to set up a cron job. And before you tell me to RTFM, I've already done that as well as several exchanges on mailing lists and a couple of online tutorials. I'm here to tell you that I'm confused. You may need to know that I'm running SuSE Linux 9.0, since SuSE appears to handle cron jobs differently than everyone else. All I want to do is run a simple backup job every morning (early). I'm pretty sure that I can set up the crontab entry to do that. What I don't know is where to put it. I've looked at /etc/cron, /etc/cron.daily (contains a number of scripts), etc. Is there an existing script that I modify or do I create one from scratch? I'd really appreciate any assistance here. Don Henson
The Wednesday 2004-03-17 at 20:26 -0700, Donald Henson wrote:
All I want to do is run a simple backup job every morning (early). I'm pretty sure that I can set up the crontab entry to do that. What I don't know is where to put it. I've looked at /etc/cron, /etc/cron.daily (contains a number of scripts), etc. Is there an existing script that I modify or do I create one from scratch? I'd really appreciate any assistance here.
Not there. Simply issue "crontab -e" as the user you want to run your job as. Those diretories you mentioned work diferently, you can not choose the exact hour they are run: only once a day, a week, etc. If you are not happy with vi as an editor, use instead "EDITOR=mcedit crontab -e" (or any other editor you like, but not an X one). -- Cheers, Carlos Robinson
You really want to look at "man crontab" <g> If your userid has permission to run a cron job, the crontab command puts you into a 'crontab edit' mode. On exit, it automatically installs the resulting file into the right spot. You might also want to invest in O'Reilly "Essential System Administration" (see http://www.oreilly.com/catalog/esa3/) That covers most unixes and Linuxes and has a great section on cron. HTH /Hans On Wednesday 17 March 2004 20:26, Donald Henson wrote:
Before you blow me off, let me say that I've been using Linux for about six months and this is the first time I've had occasion to set up a cron job. And before you tell me to RTFM, I've already done that as well as several exchanges on mailing lists and a couple of online tutorials. I'm here to tell you that I'm confused. You may need to know that I'm running SuSE Linux 9.0, since SuSE appears to handle cron jobs differently than everyone else.
All I want to do is run a simple backup job every morning (early). I'm pretty sure that I can set up the crontab entry to do that. What I don't know is where to put it. I've looked at /etc/cron, /etc/cron.daily (contains a number of scripts), etc. Is there an existing script that I modify or do I create one from scratch? I'd really appreciate any assistance here.
Don Henson
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 17 March 2004 21:26, Donald Henson wrote:
Before you blow me off, let me say that I've been using Linux for about six months and this is the first time I've had occasion to set up a cron job. And before you tell me to RTFM, I've already done that as well as several exchanges on mailing lists and a couple of online tutorials. I'm here to tell you that I'm confused. You may need to know that I'm running SuSE Linux 9.0, since SuSE appears to handle cron jobs differently than everyone else.
All I want to do is run a simple backup job every morning (early). I'm pretty sure that I can set up the crontab entry to do that. What I don't know is where to put it. I've looked at /etc/cron, /etc/cron.daily (contains a number of scripts), etc. Is there an existing script that I modify or do I create one from scratch? I'd really appreciate any assistance here.
Don Henson Add 'kcron' to your mix. That may help.
...CH Avoid doing business with 'The Link' ISP. SuSE Is All U Need Linux user# 313696 Linux box# 199365 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQFAWRliamdq40EXXvQRAn7FAJ4wxWzxYcrc+nxzrGYkb/JXt/9OawCfaBPP UJgx3dzyz2XfJPxwUu5V9lM= =+Up+ -----END PGP SIGNATURE-----
Hi,
I'm assuming that you have written the script to do your backup.
You could use your personal crontab:
crontab -e
53 3 * * *
type crontab -e and enter it there. On Wednesday 17 March 2004 19:26, Donald Henson wrote:
Before you blow me off, let me say that I've been using Linux for about six months and this is the first time I've had occasion to set up a cron job. And before you tell me to RTFM, I've already done that as well as several exchanges on mailing lists and a couple of online tutorials. I'm here to tell you that I'm confused. You may need to know that I'm running SuSE Linux 9.0, since SuSE appears to handle cron jobs differently than everyone else.
All I want to do is run a simple backup job every morning (early). I'm pretty sure that I can set up the crontab entry to do that. What I don't know is where to put it. I've looked at /etc/cron, /etc/cron.daily (contains a number of scripts), etc. Is there an existing script that I modify or do I create one from scratch? I'd really appreciate any assistance here.
Don Henson
Hi Donald,
* Donald Henson
Before you blow me off, let me say that I've been using Linux for about six months and this is the first time I've had occasion to set up a cron job. And before you tell me to RTFM, I've already done that as well as several exchanges on mailing lists and a couple of online tutorials. I'm here to tell you that I'm confused. You may need to know that I'm running SuSE Linux 9.0, since SuSE appears to handle cron jobs differently than everyone else.
Know how you feel! Others have mentioned crontab -e. I didn't know about this until they responded to your post. FWIW, I do it this way: - create a text file in your home dir (location of your choice) and have the necessary statements. Here's a bit from mine: SHELL=/bin/sh PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin 20 17,22 * * 1-5 /usr/bin/getmail - as root issue crontab - u <username> /home/username/pathtofile/filename - as root issue crontab - u <username> -l the later will list the crontab entry, and it will look like: rrl03:~ # crontab -u roland -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/home/roland/Files/rahcron installed on Sun Mar 14 15:26:25 2004) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) SHELL=/bin/sh PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin 20 17,22 * * 1-5 /usr/bin/getmail Those more experienced may do it better, but this works for me. Hope this is of some help. -- Regards, Roland Hill Registered Linux User #330226 http://pl.net/~rnrhill/rhweb.htm @ http://counter.li.org
----- Original Message -----
From: "Carlos E. R."
The Wednesday 2004-03-17 at 20:26 -0700, Donald Henson wrote:
All I want to do is run a simple backup job every morning (early). I'm pretty sure that I can set up the crontab entry to do that. What I don't know is where to put it. I've looked at /etc/cron, /etc/cron.daily (contains a number of scripts), etc. Is there an existing script that I modify or do I create one from scratch? I'd really appreciate any assistance here.
Not there. Simply issue "crontab -e" as the user you want to run your job as. Those diretories you mentioned work diferently, you can not choose the exact hour they are run: only once a day, a week, etc.
If you are not happy with vi as an editor, use instead "EDITOR=mcedit crontab -e" (or any other editor you like, but not an X one).
Another option is to use the 'read from file' option of crontab. Use whatever editor you prefer to create a file (I use cronset) which contains the necessary instructions for crontab. Then, you execute crontab passing it the filename as the only parameter. $ crontab cronset JimW
Quote from SuSE 9.0 Admin Manual: "/etc/crontab cannot be processed with crontab -e. It must be loaded directly into an editor, modified, then saved." But does that mean that's where I should put my cron job? It doesn't say. By the way, I've also looked at "man crontab" and, as usual, I was unable to extract any useful info. Whoever writes the man pages must speak a language I don't understand. As far as I can tell, the man pages are intended for experienced administrators who just need a reminder of something they already know about. It does not appear to be targeted at newbies. Don Henson On Wed, 2004-03-17 at 20:35, Hans Forbrich wrote:
You really want to look at "man crontab" <g>
If your userid has permission to run a cron job, the crontab command puts you into a 'crontab edit' mode. On exit, it automatically installs the resulting file into the right spot.
You might also want to invest in O'Reilly "Essential System Administration" (see http://www.oreilly.com/catalog/esa3/) That covers most unixes and Linuxes and has a great section on cron.
HTH /Hans
On Wednesday 17 March 2004 20:26, Donald Henson wrote:
Before you blow me off, let me say that I've been using Linux for about six months and this is the first time I've had occasion to set up a cron job. And before you tell me to RTFM, I've already done that as well as several exchanges on mailing lists and a couple of online tutorials. I'm here to tell you that I'm confused. You may need to know that I'm running SuSE Linux 9.0, since SuSE appears to handle cron jobs differently than everyone else.
All I want to do is run a simple backup job every morning (early). I'm pretty sure that I can set up the crontab entry to do that. What I don't know is where to put it. I've looked at /etc/cron, /etc/cron.daily (contains a number of scripts), etc. Is there an existing script that I modify or do I create one from scratch? I'd really appreciate any assistance here.
Don Henson
On Wed, 2004-03-17 at 20:37, C Hamel wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wednesday 17 March 2004 21:26, Donald Henson wrote:
Before you blow me off, let me say that I've been using Linux for about six months and this is the first time I've had occasion to set up a cron job. And before you tell me to RTFM, I've already done that as well as several exchanges on mailing lists and a couple of online tutorials. I'm here to tell you that I'm confused. You may need to know that I'm running SuSE Linux 9.0, since SuSE appears to handle cron jobs differently than everyone else.
All I want to do is run a simple backup job every morning (early). I'm pretty sure that I can set up the crontab entry to do that. What I don't know is where to put it. I've looked at /etc/cron, /etc/cron.daily (contains a number of scripts), etc. Is there an existing script that I modify or do I create one from scratch? I'd really appreciate any assistance here.
Don Henson Add 'kcron' to your mix. That may help.
That looks like a possibility. Thanks. I'll check it out. Don Henson
On Wed, 2004-03-17 at 20:38, Jonathan Lim wrote:
Hi,
I'm assuming that you have written the script to do your backup.
You could use your personal crontab: crontab -e 53 3 * * *
Or, if you want a system crontab then just add your script to cron.daily directory. It should run everything in there at night
Hope that helps.
Helps, yes. I'm not sure I fully understand but I think I'm beginning to see the light. Thanks. Don Henson
On Wed, 2004-03-17 at 20:34, Carlos E. R. wrote:
The Wednesday 2004-03-17 at 20:26 -0700, Donald Henson wrote:
All I want to do is run a simple backup job every morning (early). I'm pretty sure that I can set up the crontab entry to do that. What I don't know is where to put it. I've looked at /etc/cron, /etc/cron.daily (contains a number of scripts), etc. Is there an existing script that I modify or do I create one from scratch? I'd really appreciate any assistance here.
Not there. Simply issue "crontab -e" as the user you want to run your job as. Those diretories you mentioned work diferently, you can not choose the exact hour they are run: only once a day, a week, etc.
If you are not happy with vi as an editor, use instead "EDITOR=mcedit crontab -e" (or any other editor you like, but not an X one).
So if I want the cron job to be run by root, I just log in as root and issue the command 'crontab -e'? Don Henson
On Thu, 2004-03-18 at 02:56, Roland Hill wrote:
Know how you feel!
Others have mentioned crontab -e. I didn't know about this until they responded to your post.
Yes. It appears that once you understand it, entering a cron job is trivial but there's also a pretty large learning curve. Those who already know how to do it forget that newbies seem to have a lot of trouble understanding cron jobs. Anyway, thanks for your response. I'll put it in the queue with all the other responses and see if I can get the light to come on. Don Henson
On Thu, 2004-03-18 at 08:19, Jim Westbrook wrote:
----- Original Message ----- From: "Carlos E. R."
To: "SuSE Linux E" Sent: Wednesday, March 17, 2004 21:34 Subject: Re: [SLE] Cron Jobs The Wednesday 2004-03-17 at 20:26 -0700, Donald Henson wrote:
All I want to do is run a simple backup job every morning (early). I'm pretty sure that I can set up the crontab entry to do that. What I don't know is where to put it. I've looked at /etc/cron, /etc/cron.daily (contains a number of scripts), etc. Is there an existing script that I modify or do I create one from scratch? I'd really appreciate any assistance here.
Not there. Simply issue "crontab -e" as the user you want to run your job as. Those diretories you mentioned work diferently, you can not choose the exact hour they are run: only once a day, a week, etc.
If you are not happy with vi as an editor, use instead "EDITOR=mcedit crontab -e" (or any other editor you like, but not an X one).
Another option is to use the 'read from file' option of crontab. Use whatever editor you prefer to create a file (I use cronset) which contains the necessary instructions for crontab. Then, you execute crontab passing it the filename as the only parameter.
$ crontab cronset
JimW
Thanks. I'll put that one in my list as well. Don Henson
On Thu, 2004-03-18 at 10:05, Marshall Heartley wrote:
<snip>
So if I want the cron job to be run by root, I just log in as root and issue the command 'crontab -e'?
You can either su to root and then do crontab -e or you can do sux and use a graphical interface.
Marshall
Thanks. I'll try it. Don Henson
On Thu, 2004-03-18 at 10:38, pinto wrote:
On Thursday 18 March 2004 17:00, Donald Henson wrote:
So if I want the cron job to be run by root, I just log in as root and issue the command 'crontab -e'?
~ that is it.
the file is :-
/var/spool/cron/tabs/root
Thanks. The light's getting brighter. Don Henson
The Thursday 2004-03-18 at 09:50 -0700, Donald Henson wrote:
"/etc/crontab cannot be processed with crontab -e. It must be loaded directly into an editor, modified, then saved." But does that mean that's where I should put my cron job? It doesn't say.
That file is the system crontab, mantained by suse, or yast. It may get overwriten with updates. The other is the user crontab, and root has his own.
By the way, I've also looked at "man crontab" and, as usual, I was unable to extract any useful info. Whoever writes the man pages must speak a language I don't understand. As far as I can tell, the man pages are intended for experienced administrators who just need a reminder of something they already know about. It does not appear to be targeted at newbies.
That's right! But there are books. -- Cheers, Carlos Robinson
Hi Donald,
* Donald Henson
Others have mentioned crontab -e. I didn't know about this until they responded to your post.
Yes. It appears that once you understand it, entering a cron job is trivial but there's also a pretty large learning curve. Those who already know how to do it forget that newbies seem to have a lot of trouble understanding cron jobs. Anyway, thanks for your response. I'll put it in the queue with all the other responses and see if I can get the light to come on.
Just had a thought, way after all the posts were posted, but are you okay with the format of a crontab i.e what each of the 5 "fields' are prior to the 'action'? Not trying to teach you to "suck eggs', but I can summarise it if needed. Hope you have it sorted anyway. -- Regards, Roland Hill Registered Linux User #330226 http://pl.net/~rnrhill/rhweb.htm @ http://counter.li.org
On Sat, 2004-03-20 at 22:34, Roland Hill wrote:
Hi Donald,
* Donald Henson
[19-03-04 09:21]: Others have mentioned crontab -e. I didn't know about this until they responded to your post.
Yes. It appears that once you understand it, entering a cron job is trivial but there's also a pretty large learning curve. Those who already know how to do it forget that newbies seem to have a lot of trouble understanding cron jobs. Anyway, thanks for your response. I'll put it in the queue with all the other responses and see if I can get the light to come on.
Just had a thought, way after all the posts were posted, but are you okay with the format of a crontab i.e what each of the 5 "fields' are prior to the 'action'? Not trying to teach you to "suck eggs', but I can summarise it if needed.
Hope you have it sorted anyway.
That was the easy part. Thanks for the offer to help, though. Don Henson
participants (10)
-
C Hamel
-
Carlos E. R.
-
Donald Henson
-
Hans Forbrich
-
Jim Westbrook
-
Jonathan Lim
-
Marshall Heartley
-
Neal haas
-
pinto
-
Roland Hill