VectorLinux
December 18, 2014, 02:45:18 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: can not edit crontab  (Read 2618 times)
aixuser01
Member
*
Posts: 86


« on: October 19, 2009, 02:57:30 pm »

I have vl 5.9 standard gold.

when I edit cron with crontab -e, it lets me make the changes and then will not write them out

I found another thread on here talking about this exact issue, but the response was go edit cron with something else and it should be fine.

first, crontab is part of the os so I think it should work. Second crontab notifies the crond to reread the file once it has been updated which editing with another editor will not do.

any thoughts on this?

oh, yes I did do crontab -l to see that all my changes were wiped out.

thanks!
Logged

Evil Overlord rule 58 My doomsday device will not employ a large red digital countdown device unless it is absolutely necessary.  If a countdown device proves to be necessary, the doomsday device will be set to activate when the counter reaches 00:10:00, rather than 00:00:00.
stretchedthin
Administrator
Vectorian
*****
Posts: 3780


WWW
« Reply #1 on: October 19, 2009, 03:08:03 pm »

I did this tut on Vectorlinux 6.0 maybe there is some detail in there that might help out.

http://www.opensourcebistro.com/Tutorial/VL60/terminal/cron/cron.htm

Logged

Vectorlinux screencasts and  tutorials can be found at....
http://www.opensourcebistro.com/blog1
http://www.youtube.com/user/vid4ken?feature=mhee
aixuser01
Member
*
Posts: 86


« Reply #2 on: October 19, 2009, 03:16:40 pm »

Thanks for the response, but I know crond is running, found that out with ps -e | grep cron

I should be able to edit root cron with crontab -e   ( as you did ) which it will let me do.
but when I do "wq" to write out the chagnes they are thrown away.
crontab -l confirms my edits are gone.

thoughts?
Logged

Evil Overlord rule 58 My doomsday device will not employ a large red digital countdown device unless it is absolutely necessary.  If a countdown device proves to be necessary, the doomsday device will be set to activate when the counter reaches 00:10:00, rather than 00:00:00.
stretchedthin
Administrator
Vectorian
*****
Posts: 3780


WWW
« Reply #3 on: October 19, 2009, 04:15:42 pm »

Quote
but when I do "wq" to write out the chagnes they are thrown away.

1st idea....
I imaging Vim is the default editor for crontab in 5.9 just as it is in 6.0.
I'm not an expert on VIM so I use the book "A practicle guide to Linux Commands, Editors and shell programming" to help me out.  I couldn't find the command "wq" anywhere in the chapter associated with Vim.

Try making the changes but this time exit out with shift ZZ from command mode. Thats 'shift'+'z''z' not 'ctrl' + 'z''z' the book mentions to be careful of this.
It also mentions that you need to have exited out of INSERT mode with Esc because shift ZZ will only work in command mode.
You can use the tut as an example of this.

2nd idea..
Create a text file with the crontab instructions you want and name it something.txt and place it in your /home/username directory. 
Then just...
crontab ~/something.txt
The tut has an example of this as well.

If these don't work then maybe a fellow 5.9 user can be of help,  I just don't have 5.9 on any of my machines currently and perhaps it is using a different editor by default.
« Last Edit: October 19, 2009, 04:20:06 pm by stretchedthin » Logged

Vectorlinux screencasts and  tutorials can be found at....
http://www.opensourcebistro.com/blog1
http://www.youtube.com/user/vid4ken?feature=mhee
rbistolfi
Packager
Vectorian
****
Posts: 2291


« Reply #4 on: October 19, 2009, 06:45:37 pm »

This is a small bug. Vim writes backup files in the working directory confusing cron.  Add this to your vimrc (actually should be the system wide vimrc or the root vimrc)

Code:
set backupskip+=/var/spool/cron/*

The system wide vimrc is in /usr/share/vim/vimrc iirc, or you can just use /root/.vimrc
This is fixed in our Vim 7.2 packages for VL6, but I couldnt backport the fix yet.
Let us know if it works for you.
Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
Pita
Vectorian
****
Posts: 1319


« Reply #5 on: October 19, 2009, 07:40:13 pm »

What I did:

sudo mcedit /var/spool/cron/crontabs/user

since I have/had the same problem.

Will try rbistolfi suggestion.
Logged
stretchedthin
Administrator
Vectorian
*****
Posts: 3780


WWW
« Reply #6 on: October 19, 2009, 07:43:01 pm »

Hey, sorry to have lead you astray.  Looks like the problem was with 5.9 all along.
Hope the suggested fix solve the problem.
Logged

Vectorlinux screencasts and  tutorials can be found at....
http://www.opensourcebistro.com/blog1
http://www.youtube.com/user/vid4ken?feature=mhee
Pita
Vectorian
****
Posts: 1319


« Reply #7 on: October 19, 2009, 07:49:17 pm »

I just checked this problem is gone in my present box, VL-6-LIGHT-Modified.
Logged
gamfa
Vectorite
***
Posts: 245



« Reply #8 on: October 20, 2009, 07:35:51 am »

Quote
Create a text file with the crontab instructions you want and name it something.txt and place it in your /home/username directory.
Then just...
crontab ~/something.txt

This has always been my method when using cron.
Logged

"Don't tell my cattle I have leather seats in my truck"

"I never let schooling stand in the way of my education"...Mark Twain
aixuser01
Member
*
Posts: 86


« Reply #9 on: October 20, 2009, 07:57:24 pm »

rbistolfi,
thanks for your response. I agree not a huge bug since there were several work arounds for it, though I wonder if there are other larger issues.

for example I edited /root/.vimrc and there was no effect at all so i had to edit
/usr/share/vim/vimrc to get the change.

I'd really like to thank all those folks out there who read and provide support. This is the reason I use VL instead of something else.

thanks again.
Logged

Evil Overlord rule 58 My doomsday device will not employ a large red digital countdown device unless it is absolutely necessary.  If a countdown device proves to be necessary, the doomsday device will be set to activate when the counter reaches 00:10:00, rather than 00:00:00.
rbistolfi
Packager
Vectorian
****
Posts: 2291


« Reply #10 on: October 20, 2009, 08:21:37 pm »

for example I edited /root/.vimrc and there was no effect at all so i had to edit
/usr/share/vim/vimrc to get the change.

I never got that one, I will check it out. Glad it worked for you.
Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!