LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   crontab (https://www.linuxquestions.org/questions/linux-newbie-8/crontab-730388/)

ghartl1 06-03-2009 08:07 AM

crontab
 
hi,

i use slackware 12.2 with kde

i deinstalled the elvis package. instead i created a symlink from vim to vi...so vim is my standrdeditor.

nonetheless i cant modify my crontab...

whenever i edit it (crontab -e..as root)and did my changes..saved the file (no error-reports emerged) and looked afterwards on the file (crontab -l) the old file was present...without the changes..

is this an eviroment variable issue? and if, here and how can i fix it?

i want to keep vim as my standrdeditor..no probs so far...except the crontab-issue


anybody out there, who encounters the same problem..and has a workaround?

or better question...how do you edit crontab in slackware?

any hints would be helpful

thanks for yout time and effort in advance

greets günter

rweaver 06-03-2009 08:17 AM

try this:

Code:

export EDITOR=vim
crontab -e

If that works just add the same line to your login scripts (.bashrc, .bash_profile, whatever)

sl33p 06-03-2009 08:29 AM

Hey ghartl1,

I noticed that crontab looks for the $VISUAL env. variable prior to the $EDITOR one.
So, try setting the $VISUAL/$EDITOR environment variables permanently, by adding these lines inside the file /etc/profile:

Code:

export VISUAL="vim"
export EDITOR="vim"


Hope that helps.
sl33p

ghartl1 06-03-2009 09:02 AM

sorry no avail...

the variable stuff was only an assumption from me....a shot in the blue maybe

any other suggestions?

btw..do you use slackware too..how do you handle this??

greets günter

sl33p 06-03-2009 09:36 AM

Ok,

The file crontab.####~ is created inside '/var/spool/cron/' directory when u type
Code:

#crontab -e
and save the file, whatever the editor is.
God knows why this file is not saved as we edited and saved it.

The real file (and the one returned by the command #crontab -l) is inside:
'/var/spool/cron/crontabs/your_user'

So if you want effectively edit the crontab for your user, edit the file above and save it.
That's the way I found to make it work on Slack.

HTH
sl33p

ghartl1 06-03-2009 11:02 AM

thanks..worked...

so i assume, this "fault" is not only on my box??

as far as i know how to edit it...what shells....do you know if this is common in slack?

thanks anyway

greets günter

sl33p 06-04-2009 08:37 AM

well, I think that might be different approaches, probably this is not a fault.

But only senior Linux Slack users can tell us so. :)

Even after reading the crontab man page ($man crontab) I couldn't find anything useful on this matter. :/

I like how things are done in Slack, you have to find out everything for yourself so you end up learning a lot about Linux.

Ow, if it helped somehow, please press the "Thanks" button on my hint. :)

Rgds,
sl33p

ghartl1 06-04-2009 08:47 AM

sorry,

i am not quite familiar what you mean with " click my thanks button...."

anyway.many thanks to your hint...

greets günter

sl33p 06-05-2009 09:54 AM

Well, the trick is to press the "thumb-shaped" button close to the "Quote" button, on any of my boxes (including this one).
But as I can see, you've already done it. :)

This was my first Thanks, so in fact "I" have to thank you for it, lol...

Regards,

ghartl1 06-05-2009 10:07 AM

got it :-))


All times are GMT -5. The time now is 08:09 AM.