LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-12-2006, 01:29 AM   #1
kiley_rodgers
Member
 
Registered: May 2003
Location: Chicago
Distribution: Slackware 9
Posts: 34

Rep: Reputation: 15
Crontab -e does not save


Not necessarily a newbie, but this question may sound like it. I am running Slack 10.2/XFCE4 (recently reloaded from scratch). Anyway, while trying to bring the system back to it's pre-rebuild state, I was trying to add my crontab entries back. When I do 'crontab -e' and add a line, it will not save. Instead of the changes being reflected in the '/var/spool/cron/crontabs' directory, they seem to be going to the '/var/spool/cron/' directory <see below>

root@kiley:/var/spool/cron# ls
cron.root.1011 cron.root.11261 cron.root.11894 cron.root.14378 cron.root.14967 cron.root.1724 cron.root.2382 cron.root.29284 cron.root.31373 cron.root.3472 cron.root.5107 cron.root.7718
cron.root.29137 cron.root.3098 cron.root.3414 cron.root.4907 cron.root.7438 crontabs/
cron.root.1124 cron.root.11865 cron.root.14327 cron.root.1493 cron.root.1695 cron.root.2353 cron.root.29176 cron.root.31107 cron.root.3443 cron.root.500 cron.root.754


Infact if I do a ':w!' when exiting the editor I get.....

"/var/spool/cron/crontab.2728" 27L, 1339C written


To change a crontab I have to directly vi (really using vim)

lrwxrwxrwx 1 root root 3 2005-12-15 07:39 /usr/bin/vi -> vim*

and save he changes....


Any suggestions, I would assume this is a configuration mistake.


Thanks,

Kiley
 
Old 01-12-2006, 01:52 AM   #2
kiley_rodgers
Member
 
Registered: May 2003
Location: Chicago
Distribution: Slackware 9
Posts: 34

Original Poster
Rep: Reputation: 15
OK, I thing I figured it out. After searching days on Google, it would figure that once I posted a question I would find the answer just minutes afterwards. The answer.... if I exit the editor with 'ZZ' or ':w!' hte changes would not be saved. However if I exit with ':wq', the file save correctly and can be viewed with 'crontab -l'. Has this alsways been the case? I do not recall having this issue in the past...

Thank,
Kiley
 
Old 01-12-2006, 04:48 AM   #3
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Rep: Reputation: 32
what happens if you try crontab -l

TT
 
Old 01-12-2006, 05:15 AM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by tommytomato
what happens if you try crontab -l

TT
That only lists the crontab, does not open up to edit it.

:w! should write to the file with no problems. You would then use :q! to quit. Shift+ZZ should do basically the same thing, save and exit. :wq! is just a combo of write then quit. If it only works with the wq! combo, then somethings seriously wrong with your editor, which is actually elvis on Slackware since vi is actually never installed and elvis is a clone of it.
 
Old 01-12-2006, 05:17 AM   #5
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Rep: Reputation: 32
for me I use

crontab -e press i to edit then to save I press ESC key then : then w then q

is that any help ?

TT
 
Old 01-12-2006, 05:19 AM   #6
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by tommytomato
for me I use

crontab -e press i to edit then to save I press ESC key then : then w then q

is that any help ?

TT
That's what they're already explaining and having problems with. Apparently it only works when they use the :wq! combo..
 
Old 01-13-2006, 09:53 AM   #7
kiley_rodgers
Member
 
Registered: May 2003
Location: Chicago
Distribution: Slackware 9
Posts: 34

Original Poster
Rep: Reputation: 15
Sorry for taking so long to reply (had long night). Anyway..... When I rebuily my system is removed the symbolic between vi ->elvis and made a new one vi->vim. After testing again, I have found that the :wq! does not consistently work. Strange still nothing..... If I do a 'crontab -e', it will never save the changes. The changes are still being saved in the base '/var/spool/cron' directories instead of the '/var/spool/cron/crontabs/<username>' file. Could it be that I changed the vi link from elvis to vim. I would not think it would be te cause, since I us vi(vim) 1000's time a day.


Thanks for your help!!!

kiley
 
Old 01-13-2006, 09:59 AM   #8
kiley_rodgers
Member
 
Registered: May 2003
Location: Chicago
Distribution: Slackware 9
Posts: 34

Original Poster
Rep: Reputation: 15
hmmmmmm......strange..... I just went back and deleted my link from vi -> vim and replaced it with 'ln -s /usr/bin/elvis /usr/bin/vi'. Now it works when I do 'crontab -e'.... the changes are saved... why would that matter????


kiley
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
su in crontab nonothing Linux - General 4 12-15-2004 08:58 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM
Crontab WiWa Linux - Software 1 10-06-2003 05:20 PM
Crontab Gorbachov Linux - Software 3 09-26-2003 04:40 PM
crontab alaios Linux - General 5 05-01-2003 03:26 PM


All times are GMT -5. The time now is 07:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration