Does anyone know if there's a way to set up a cron job using YaST? Thanks for any info. Don Henson
On Wednesday 21 January 2004 06:10 am, Donald Henson wrote:
Does anyone know if there's a way to set up a cron job using YaST?
Took a quick look and didn't see anything there. If you're looking for a graphical program try kcron. I'm guessing you can run it as root by Alt-F2>>kdesu kcron. Try it and see. -- Bryce Hardy (Santa Rosa, CA) cygnia@sonic.net
On Wed, 2004-01-21 at 08:20, Bryce Hardy wrote:
On Wednesday 21 January 2004 06:10 am, Donald Henson wrote:
Does anyone know if there's a way to set up a cron job using YaST?
Took a quick look and didn't see anything there. If you're looking for a graphical program try kcron. I'm guessing you can run it as root by Alt-F2>>kdesu kcron. Try it and see.
-- Bryce Hardy (Santa Rosa, CA) cygnia@sonic.net
That looks like it might work. It actually came up without me being root. Perhaps I have to be root in order to save changes. Anyway, thanks for the pointer. I'll check it out. Don Henson
* Donald Henson
That looks like it might work. It actually came up without me being root. Perhaps I have to be root in order to save changes. Anyway, thanks for the pointer. I'll check it out.
No, cron has user accounts. You only need to be root to change root's crontab. You need to be yourself to change your crontab. -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org
Patrick Shanahan wrote:
* Donald Henson
[01-21-04 16:42]: That looks like it might work. It actually came up without me being root. Perhaps I have to be root in order to save changes. Anyway, thanks for the pointer. I'll check it out.
No, cron has user accounts. You only need to be root to change root's crontab. You need to be yourself to change your crontab.
Question: When a root's crontab got modified and is saved, is it automatic to be installed ? If not, how should it be installed ? thanks
Hi,
Question:
When a root's crontab got modified and is saved, is it automatic to be installed ? If not, how should it be installed ?
Only if you modify it using 'crontab -e' (without quotes). To install a crontab from a text file, provided that you use cron's proper format, just issue a command like 'crontab yourfile' (again, without quotes). HTH, Martin
On Wednesday 21 January 2004 01:42 pm, Donald Henson wrote:
Took a quick look and didn't see anything there. If you're looking for a graphical program try kcron. I'm guessing you can run it as root by Alt-F2>>kdesu kcron. Try it and see.
That looks like it might work. It actually came up without me being root. Perhaps I have to be root in order to save changes. Anyway, thanks for the pointer. I'll check it out.
I assumed that since you wanted a YAST program for cron that you were looking to have cron jobs running as root for the whole system. You can run kcron as a regular user also. That's how I wake up in the morning with a cron job to play a song at 7 AM except on my two days off. But I have to make sure the box is logged in as me overnight, or (again I'm guessing here, I'm no expert) it won't go off. -- Bryce Hardy (Santa Rosa, CA) cygnia@sonic.net
On 01/22/2004 01:13 PM, Bryce Hardy wrote:
You can run kcron as a regular user also. That's how I wake up in the morning with a cron job to play a song at 7 AM except on my two days off. But I have to make sure the box is logged in as me overnight, or (again I'm guessing here, I'm no expert) it won't go off.
As long as your computer is on, it will run the program. Since it is 'your' cron, it will run with your permissions, whether you are logged in or not. Using your Linux box as an alarm clock, great idea. Just make sure the program you run has all it needs to run, i.e. not graphical unless you are logged in to X, etc. -- Joe Morris New Tribes Mission Email Address: Joe_Morris@ntm.org Web Address: http://www.mydestiny.net/~joe_morris Registered Linux user 231871 God said, I AM that I AM. I say, by the grace of God, I am what I am.
On Thursday 22 January 2004 04:04 am, Joe Morris (NTM) wrote:
As long as your computer is on, it will run the program.
Thanks for the correction. I didn't know that.
Since it is 'your' cron, it will run with your permissions, whether you are logged in or not.
OK, I get the theory now. That makes sense since the box would have to be logged in as root to run a root cron job if my theory were correct.
Using your Linux box as an alarm clock, great idea. Just make sure the program you run has all it needs to run, i.e. not graphical unless you are logged in to X, etc.
Right, I use the "play" command, included in the "sox" package, then enter the command "play <path-to-song-file>". -- Bryce Hardy (Santa Rosa, CA) cygnia@sonic.net
Martin Mielke wrote:
Hi,
OK, I get the theory now. That makes sense since the box would have to be logged in as root to run a root cron job if my theory were correct.
Again, the user, no matter if root or not, must not be logged on for crond to execute their crontab.
I believe you mean 'the user does not have to be logged on.' The user can be logged on and cron will still function. Further on this discussion, root can modify any user's crontab as follows: # crontab -u userid -e -- Until later, Geoffrey esoteric@3times25.net Building secure systems inspite of Microsoft
On Thu, 2004-01-22 at 12:00, Martin Mielke wrote:
Hi,
OK, I get the theory now. That makes sense since the box would have to be logged in as root to run a root cron job if my theory were correct.
Again, the user, no matter if root or not, must not be logged on for crond to execute their crontab.
That is not true. You need -not- be logged in for your crontab to run. Take a look at your /var/log/messages and look at how many messages there are regarding cron jobs run by root when root was not logged in. -- Ken Schneider unix user since 1989 linux user since 1994 SuSE user since 1998 (5.2)
On Thu, 2004-01-22 at 10:00, Martin Mielke wrote:
Hi,
OK, I get the theory now. That makes sense since the box would have to be logged in as root to run a root cron job if my theory were correct.
Again, the user, no matter if root or not, must not be logged on for crond to execute their crontab.
I didn't know that. It seems like kind of an important detail to miss. Thanks. Don Henson
Wednesday Jan 22 04 at 11:53am, Donald Henson wrote:
On Thu, 2004-01-22 at 10:00, Martin Mielke wrote:
Hi,
OK, I get the theory now. That makes sense since the box would have to be logged in as root to run a root cron job if my theory were correct.
Again, the user, no matter if root or not, must not be logged on for crond to execute their crontab.
Martin, where did you get that??? I have a user crontab that always executes whether I'm logged on or not. Just for a silly test, I added the following line to it: 0-59/2 * * * * date >>/home/jcunning/timenow and after a few minutes, I got this jcunning@bigbear:~> tail -f timenow Thu Jan 22 11:02:00 PST 2004 Thu Jan 22 11:04:00 PST 2004 Thu Jan 22 11:06:00 PST 2004 Clearly crond is executing my cron job while I'm logged on. Jim
The Wednesday 2004-01-21 at 21:13 -0800, Bryce Hardy wrote:
a regular user also. That's how I wake up in the morning with a cron job to play a song at 7 AM except on my two days off. But I have to make sure the box is logged in as me overnight, or (again I'm guessing here, I'm no expert) it won't go off.
No, your job will run regardless of whom, if any, is logged in. However, it might not have access to the sound device if somebody else is logged in. That's why in this case I would use a root cronjob. -- Cheers, Carlos Robinson
On Wed, 2004-01-21 at 22:13, Bryce Hardy wrote:
On Wednesday 21 January 2004 01:42 pm, Donald Henson wrote:
Took a quick look and didn't see anything there. If you're looking for a graphical program try kcron. I'm guessing you can run it as root by Alt-F2>>kdesu kcron. Try it and see.
That looks like it might work. It actually came up without me being root. Perhaps I have to be root in order to save changes. Anyway, thanks for the pointer. I'll check it out.
I assumed that since you wanted a YAST program for cron that you were looking to have cron jobs running as root for the whole system. You can run kcron as a regular user also. That's how I wake up in the morning with a cron job to play a song at 7 AM except on my two days off. But I have to make sure the box is logged in as me overnight, or (again I'm guessing here, I'm no expert) it won't go off.
I missed the kdesu part. (I use Gnome almost exclusively.) But your first assumption was correct. I want to set up a cron job to run my nightly backup so it would need to be set up as root. In the meantime, I've run into a bigger problem. I can't figure out how to install rdiff-backup. Don Henson
Donald Henson wrote:
Does anyone know if there's a way to set up a cron job using YaST?
I don't know about YaST, but it's easy to create a file in /etc/cron.d/ with the jobs you need to run. Syntax is standard crontab (same as in /etc/crontab).
Hi,
Donald Henson wrote:
Does anyone know if there's a way to set up a cron job using YaST?
crontabs with YaST? interesting... ;)
I don't know about YaST, but it's easy to create a file in /etc/cron.d/ with the jobs you need to run.
Syntax is standard crontab (same as in /etc/crontab).
A secure way to create a crontab for a user is quite simple: 1. login as the desired user, for this example I assume 'martin' 2. vi martin_crontab 3. (see man crontab for the syntax). As example: 00 5 * * 1-6 /home/martin/scripts/backup_full 4. crontab martin_crontab In point 2 you can use an editor of your choice (or create a file with 'cat
file' )
In point 3 it's said that every day (1-6, or *) at 05:00 AM execute /home/martin/scripts/backup_full (just an example, it doesn't exists :P ) In point 4 you actually install your crontab file under /var/spool/cron/tabs. If you read 'man crontab' you'll notice that you can edit your crontab file using 'crontab -e', which is easier/faster than my 2,3,4-steps, so why do I mention it? Because 'crontab -r' actually _removes_ your crontab file and there's no chance to recover it, unless you have a backup somewhere. It's not a big hasle if your crontab is as short as my example, but there are *bigger* crontabs around and retyping it all from scratch might be annoying. Because letters 'e' and 'r' are dangerously together on the keyboard, I strongly recommend you "my method"; this way you always will have a backup of your crontab file. And of course, if you need to change your crontab, do it on the martin_crontab file (assuming that your user is 'martin'). HTH, Martin
The Wednesday 2004-01-21 at 17:33 +0100, Martin Mielke wrote:
A secure way to create a crontab for a user is quite simple:
1. login as the desired user, for this example I assume 'martin' 2. vi martin_crontab
Another way (the proper one, I think): run 'crontab -e' and will open 'vi' with your user's crontab file. On exit/save, it will be automatically installed. And, for hose not liking 'vi' as an editor, edit the file '.bashrc', adding this line: export EDITOR=/usr/bin/mcedit of course, any console editor may be used - for example, joe.
If you read 'man crontab' you'll notice that you can edit your crontab file using 'crontab -e', which is easier/faster than my 2,3,4-steps, so why do I mention it? Because 'crontab -r' actually _removes_ your crontab file and there's no chance to recover it, unless you have a backup somewhere. It's not a big hasle if your crontab is as short as my example, but there are *bigger* crontabs around and retyping it all from scratch might be annoying. Because letters 'e' and 'r' are dangerously together on the keyboard, I strongly recommend you "my method"; this way you always will have a backup of your crontab file. And of course, if you need to change your crontab, do it on the martin_crontab file (assuming that your user is 'martin').
Mmmmm.... interesting idea. Not convinced, though O:-) I simply make a backup copy of the file instead - which should be done, regardless of method. -- Cheers, Carlos Robinson
On Wed, 2004-01-21 at 09:01, Silviu Marin-Caea wrote:
Donald Henson wrote:
Does anyone know if there's a way to set up a cron job using YaST?
I don't know about YaST, but it's easy to create a file in /etc/cron.d/ with the jobs you need to run.
Syntax is standard crontab (same as in /etc/crontab).
That'll work also but it occurred to me that setting up cron jobs could be easily set up as part of YaST and would be appropriate since YaST is kind of like <whisper> the MS Windows Control Panel </whisper>. But apparently not. Ce la vie. Don Henson
participants (12)
-
Anders Johansson
-
Bryce Hardy
-
Carlos E. R.
-
Donald Henson
-
Geoffrey
-
Jim Cunning
-
Joe Morris (NTM)
-
Kenneth Schneider
-
Martin Mielke
-
Patrick Shanahan
-
Silviu Marin-Caea
-
Yasushi Okubo