Re: [newbie] crontab -e doesn't work
On Saturday 15 Mar 2003 1:18 am, Andy Davidson wrote: I recently installed Mandrake 9.0 on my laptop and have run into some oddities. The first is crontab. If I do 'crontab -e', it brings up my editor (emacs), but when I exit it, I get the message crontab: no changes made to crontab The only way I can create or change my crontab entry is to: edit a file, e.g., crontabstuff crontab -r crontab crontabstuff Why? andy This sounds like a two phase save problem. In order not to loose your work if there is a catastrophic crash, many editors save the edited file under a temporary name, then rename the original as a backup, and rename the saved file under the original name. If any program has the file open for reading, they will still have the original file open, and not the new file. If there is a link to the old file, it will still point to the old file. There will be a way to disable two phase saving in emacs, because it is a known problem. But I was last an emacs guru ten years ago, so you'll have to go looking for it. -- Richard Urwin Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] crontab -e doesn't work
ls test; emacs test; echo $? Betcha the exit value is non-zero. Same here: it's zero. Miark Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] crontab -e doesn't work
On Sat, Mar 15, 2003 at 10:07:39AM +, Richard Urwin wrote: This sounds like a two phase save problem. In order not to loose your work if there is a catastrophic crash, many editors save the edited file under a temporary name, then rename the original as a backup, and rename the saved file under the original name. If any program has the file open for reading, they will still have the original file open, and not the new file. If there is a link to the old file, it will still point to the old file. No, I don't think that's it. I have now installed Mandrake 9.0 on my crash machine and the problem does not occur there. I can do 'crontab -e' quite successfully. Same version of Mandrake, same version of emacs, same .emacs file. So if it's not a hardware problem --- which seems extremely unlikely to me --- then it must be some system setting. Or something. andy -- Andy Davidson [EMAIL PROTECTED] If you know what you're doing, you're not learning anything. Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
[newbie] crontab -e doesn't work
I recently installed Mandrake 9.0 on my laptop and have run into some oddities. The first is crontab. If I do 'crontab -e', it brings up my editor (emacs), but when I exit it, I get the message crontab: no changes made to crontab The only way I can create or change my crontab entry is to: edit a file, e.g., crontabstuff crontab -r crontab crontabstuff Why? andy -- Andy Davidson [EMAIL PROTECTED] If you know what you're doing, you're not learning anything. Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] crontab -e doesn't work
Although I can't explain why, I know that crontab -e has a problem with eMacs. I use MicroEmacs and experience the same thing. Hmm, I should have brought that up in Bugzilla. Miark On Fri, 14 Mar 2003 17:18:47 -0800 Andy Davidson [EMAIL PROTECTED] wrote: I recently installed Mandrake 9.0 on my laptop and have run into some oddities. The first is crontab. If I do 'crontab -e', it brings up my editor (emacs), but when I exit it, I get the message crontab: no changes made to crontab The only way I can create or change my crontab entry is to: edit a file, e.g., crontabstuff crontab -r crontab crontabstuff Why? andy Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] crontab -e doesn't work
On Fri, Mar 14, 2003 at 10:43:08PM -0500, Miark wrote: Although I can't explain why, I know that crontab -e has a problem with eMacs. I use MicroEmacs and experience the same thing. Hmm, I should have brought that up in Bugzilla. I just tried 'crontab -e' after changing my EDITOR shell variable to vi. And it worked! Can anybody explain this? Emacs works fine for crontab in both 8.1 and 8.2. Are we into holy war here? andy Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] crontab -e doesn't work
On Friday 14 March 2003 09:08 pm, Andy Davidson wrote: On Fri, Mar 14, 2003 at 10:43:08PM -0500, Miark wrote: Although I can't explain why, I know that crontab -e has a problem with eMacs. I use MicroEmacs and experience the same thing. Hmm, I should have brought that up in Bugzilla. I just tried 'crontab -e' after changing my EDITOR shell variable to vi. And it worked! Can anybody explain this? Emacs works fine for crontab in both 8.1 and 8.2. Are we into holy war here? This rings a bell for me. I ran into something like it and if it's similar it's the exit value from emacs - check by editing a file using ls test; emacs test; echo $? Betcha the exit value is non-zero. Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] crontab -e doesn't work
On Fri, Mar 14, 2003 at 09:22:04PM -0700, Russ Kepler wrote: This rings a bell for me. I ran into something like it and if it's similar it's the exit value from emacs - check by editing a file using ls test; emacs test; echo $? Betcha the exit value is non-zero. Nope. It's zero. andy Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] crontab -e doesn't work...
- Original Message - From: Ron Bouwhuis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, September 29, 2001 12:16 PM Subject: Re: [newbie] crontab -e doesn't work... so that it runs my scan that adds nimda and code red clients to my ipchains rules to block them... it needs to run alot so I figure that every five minutes would be good. (have I done that right?) Frank, Cron has its uses, but is sometimes fiddly. It's also more suited to running administrative tasks at certain times of the day, week, month etc. rather than what I think you are trying to do. I saw other posts helping you understand both the editing of your crontab and the meaning of the entries, so I won't go into a discussion on that. If all you want to do is run some code every 5 minutes, a simple alternative is to put it in a script, inside a loop and put a sleep 300 command at the end of the loop. (Or you could use sleep 5m). As the sleep won't start until after your previous commands finish, you don't have to worry about having several invokations running at the same time. To illustrate the syntax: while [ x = x ] do your command(s) go in here sleep 300 done say you put this script in a file called block_nimda, you could then run it as follows: nohup ./block_nimda This will run block_nimda script in background and protect it from a hang-up signal when you log-off. There are other considerations, like writing all output to log files, with full path names, etc. Oh, and to stop the command you need to use kill! Of course, you can go fancy and build it into your init.d scripts so it runs on boot. If you need help on doing that, let me know (but try it first yourself!) Hope this helps! Ron. __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
RE: [newbie] crontab -e doesn't work...
Thanks guys, I got that added, export works fine... just gotta get the format right so it runs every 5 minutes. also, if for some reason it hasn't finished running from the previous time, is there a way to stop it running again? I don't want to crash my system by having 200 copies running by tomorrow morning... (actually, at every 5 minutes, it would no doubt happen much sooner then tomorrow morning..) rgds Frank -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Ed Kasky Sent: Sunday, 23 September 2001 10:08 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [newbie] crontab -e doesn't work... Crontab is working - what you are seeing is the vi editor Not my favorite editor in the world that's for sure. ;-) In order to be able to edit the file, press the insert key - you will see --INSERT-- at the bottom of the screen. (F1 brings up the help screen.) once you are done editing, press esc then : the wq for write/quit. If you did the steps correctly you will see a message that indicates a new crontab has been installed... O'Reilly puts out a good pocket reference fo rthe vi editor. I think I picked one up for $5 US or so... Ed ~~ At 09:53 PM Sunday, 9/23/2001, you wrote -= Hi all, I have been trying to add an entry to contab for root on my mdk 7.2 system.. when I type crontab -e it brings up a screen with an entry at the top and one at the bottom and a funny ~ char at the start of all the lines in between. like so: 0 * * * * /etc/iscan/prescan.cgi /dev/null 21 ~ ~ I cut out a heap of these characters, but you get the point. ~ ~ ~ ~ ~ ~ /tmp/crontab.16832 1L, 49C I can't seem to add one and I really need to. I want to add something like: 05 * * * * /sbin/nimda /dev/null 21 so that it runs my scan that adds nimda and code red clients to my ipchains rules to block them... it needs to run alot so I figure that every five minutes would be good. (have I done that right?) can anyone tell me why I can't enter anything? and can't I just edit a file with mcedit? I can move the cursur to the start and end of the top line, but nowhere else, and I can't get a newline (also, I am trying to do this via ssh as root.) any suggestions would be much appreciated. regards Frank Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Ed Kasky Los Angeles, CA . . . . . . . . Don't worry about the horse being blind. Just load up the wagon. ~~ John Madden Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
RE: [newbie] crontab -e doesn't work...
No that won't make it run 12 times an hour. That will make it run 12 minutes after each hour. One way I have seen it done is with */12 or you can use the brute force method and list a comma delimited set of minutes per hour in which to run the job. Keith Lynn Systems Administrator School of Computer and Information Sciences University of South Alabama Mobile, AL 36608 Phone: (334) 460-6390 Fax: (334) 460-7274 Alternative E-mail: [EMAIL PROTECTED] URL: http://www.cis.usouthal.edu/~lynn/ On Sun, 23 Sep 2001, Franki wrote: cool,, mcedit makes much more sense to me then vi (though I should probably learn to use it at some stage.. at present I use mcedit or pico for everything..) anyway, if I want to run it every five minutes... is this the right format? 12 * * * * /sbin/nimda ie run it 12 times an hour?? is that right? or does that run it 12 times a minute?? rgds Frank -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Keith Lynn Sent: Sunday, 23 September 2001 9:59 PM To: Franki Cc: NEWBIE Mandrake List Subject: Re: [newbie] crontab -e doesn't work... The way I do it is to export the editor that I use as the default editor, export EDITOR=pico, and then do crontab -e. Keith Lynn Systems Administrator School of Computer and Information Sciences University of South Alabama Mobile, AL 36608 Phone: (334) 460-6390 Fax: (334) 460-7274 Alternative E-mail: [EMAIL PROTECTED] URL: http://www.cis.usouthal.edu/~lynn/ On Sun, 23 Sep 2001, Franki wrote: Hi all, I have been trying to add an entry to contab for root on my mdk 7.2 system.. when I type crontab -e it brings up a screen with an entry at the top and one at the bottom and a funny ~ char at the start of all the lines in between. like so: 0 * * * * /etc/iscan/prescan.cgi /dev/null 21 ~ ~ I cut out a heap of these characters, but you get the point. ~ ~ ~ ~ ~ ~ /tmp/crontab.16832 1L, 49C I can't seem to add one and I really need to. I want to add something like: 05 * * * * /sbin/nimda /dev/null 21 so that it runs my scan that adds nimda and code red clients to my ipchains rules to block them... it needs to run alot so I figure that every five minutes would be good. (have I done that right?) can anyone tell me why I can't enter anything? and can't I just edit a file with mcedit? I can move the cursur to the start and end of the top line, but nowhere else, and I can't get a newline (also, I am trying to do this via ssh as root.) any suggestions would be much appreciated. regards Frank Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com