Unix Technical Forum

root ~$ crontab -e blablah :wq => no change

This is a discussion on root ~$ crontab -e blablah :wq => no change within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> hello, just wondering. Whenever I edit the root crontab through crontab -e, changes are never saved. Not a problem ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2008, 06:13 PM
paf the dog
 
Posts: n/a
Default root ~$ crontab -e blablah :wq => no change

hello,

just wondering. Whenever I edit the root crontab through crontab -e,
changes are never saved. Not a problem though, i could by editing
directly /var/spool/cron/crontabs/root

But I was wondering if it was a feature. I just wanted to change the
hour for the cron.hourly and noticed this behavior.

I am running slackware 9.0

thanks

--
paf the dog
remove primate to reply
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 06:13 PM
Glyn Millington
 
Posts: n/a
Default Re: root ~$ crontab -e blablah :wq => no change

paf the dog <pafbaboonlechien@neuf.fr> writes:

> hello,
>
> just wondering. Whenever I edit the root crontab through crontab -e,
> changes are never saved. Not a problem though, i could by editing
> directly /var/spool/cron/crontabs/root
>
> But I was wondering if it was a feature. I just wanted to change the
> hour for the cron.hourly and noticed this behavior.


Are you using Vim as your editor?

Have a look at this thread - Google is your friend :-)

http://groups.google.co.uk/groups?th...rk hill.me.uk


hth

Glyn
--
RTFM http://www.tldp.org/index.html
GAFC http://slackbook.lizella.net/
STFW http://groups.google.com/groups?hl=e...inux.slackware
GAFL http://www.xemacs.org http://www.gnus.org/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 06:14 PM
paf the dog
 
Posts: n/a
Default Re: root ~$ crontab -e blablah :wq => no change

Glyn Millington grumbled:
> paf the dog <pafbaboonlechien@neuf.fr> writes:
>
>> hello,
>>
>> just wondering. Whenever I edit the root crontab through crontab -e,
>> changes are never saved. Not a problem though, i could by editing
>> directly /var/spool/cron/crontabs/root
>>
>> But I was wondering if it was a feature. I just wanted to change the
>> hour for the cron.hourly and noticed this behavior.

>
> Are you using Vim as your editor?
>
> Have a look at this thread - Google is your friend :-)


argh what a piece of sh... I am

many thanks Glyn, VISUAL="/usr/bin/vi" crontab -e did the trick
(or simply :set compatible, either)

I should have checked google first

funny compatible mode is required for root's crontab and not user's

--
paf the dog
remove primate to reply
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 06:14 PM
Henrik Carlqvist
 
Posts: n/a
Default Re: root ~$ crontab -e blablah :wq => no change

> VISUAL="/usr/bin/vi" crontab -e did the trick

There is an even easier way to edit your crontab file:

crontab -l > /tmp/crontab.txt
(use your favorite editor to edit /tmp/crontab.txt)
crontab /tmp/crontab.txt

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc2(at)uthyres.com Examples of addresses which go to spammers:
info@k-software.biz svar@webtelevision.se info@webrider.ru root@localhost

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-19-2008, 06:14 PM
paf the dog
 
Posts: n/a
Default Re: root ~$ crontab -e blablah :wq => no change

Henrik Carlqvist grumbled:
>> VISUAL="/usr/bin/vi" crontab -e did the trick

>
> There is an even easier way to edit your crontab file:
>
> crontab -l > /tmp/crontab.txt
> (use your favorite editor to edit /tmp/crontab.txt)
> crontab /tmp/crontab.txt


thanks Henrik

atually I seldomly change anything in root's crontab (it is the first
time) and I change very few, so, just :set compatible while editing is
enough for me.

--
paf the dog
remove primate to reply
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-19-2008, 06:14 PM
Glyn Millington
 
Posts: n/a
Default Re: root ~$ crontab -e blablah :wq => no change

paf the dog <pafbaboonlechien@neuf.fr> writes:

> argh what a piece of sh... I am


Now, now - don't abuse yourself - there are plenty of folk here to do
that for you :-)

> I should have checked google first


The links below are v. useful!

atb

Glyn
--
RTFM http://www.tldp.org/index.html
GAFC http://slackbook.lizella.net/
STFW http://groups.google.com/groups?hl=e...inux.slackware
GAFL http://www.xemacs.org http://www.gnus.org/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-19-2008, 06:16 PM
Steven
 
Posts: n/a
Default Re: root ~$ crontab -e blablah :wq => no change

paf the dog wrote:
>Not a problem though, i could by editing
> directly /var/spool/cron/crontabs/root
>


I've been wondering if it's wrong to edit that file directly.
Is it? If so, why?

Thanks in advance,

StevenR

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-19-2008, 06:17 PM
paf the dog
 
Posts: n/a
Default Re: root ~$ crontab -e blablah :wq => no change

Steven grumbled:
> paf the dog wrote:
>>Not a problem though, i could by editing
>> directly /var/spool/cron/crontabs/root
>>

>
> I've been wondering if it's wrong to edit that file directly.
> Is it? If so, why?


as far as I know, crontab -e notifies the daemon that the file is
updated.

If I update manually the file (well I tried with one of a user) the
action does not take place. I think that restarting the daemon would
make the update effective, though. I assume the files are scanned on
daemon start

--
paf the dog
remove primate to reply
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-19-2008, 06:17 PM
buck
 
Posts: n/a
Default Re: root ~$ crontab -e blablah :wq => no change

On Mon, 13 Dec 2004 18:57:20 GMT, Steven <foo@spam.com> wrote:

>paf the dog wrote:
>>Not a problem though, i could by editing
>> directly /var/spool/cron/crontabs/root
>>

>
>I've been wondering if it's wrong to edit that file directly.
>Is it? If so, why?
>
>Thanks in advance,
>
>StevenR


It is OK if you are careful. I do it all the time without problems.
Well, one problem: cron only looks for changes once an hour and it is
not possible to know when it does its scan. So a change might be
ignored for as much as an hour...

I cannot find anything in the source that indicates that using crontab
-e causes the /cron/crontabs files to be rescanned.

buck

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-19-2008, 06:17 PM
Damjan
 
Posts: n/a
Default Re: root ~$ crontab -e blablah :wq => no change

>>>Not a problem though, i could by editing
>>> directly /var/spool/cron/crontabs/root
>>>

>>
>>I've been wondering if it's wrong to edit that file directly.
>>Is it? If so, why?


> It is OK if you are careful. I do it all the time without problems.
> Well, one problem: cron only looks for changes once an hour and it is
> not possible to know when it does its scan. So a change might be
> ignored for as much as an hour...
>
> I cannot find anything in the source that indicates that using crontab
> -e causes the /cron/crontabs files to be rescanned.


It leaves a /var/spool/cron/crontabs/cron.update file, containing the
username whos cron file should be reread. I think cron checks for this file
once in a minute.


--
damjan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com