LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-29-2020, 10:29 AM   #1
rakeshmanmohan
LQ Newbie
 
Registered: Mar 2016
Posts: 1

Rep: Reputation: Disabled
Why Does Crontab -e Command Open In GUI Text Editor?


My employer purchased a desktop PC with a custom Linux installation, CentOS 6.9. The vendor is not providing any support. On this desktop I am trying to automate a simple script I created using crontab, strangely, whenever I run the command 'crontab -e' it opens in a GUI text editor.

I enter the cron job I need, click the save button on the text editor and close it, however, when I run 'crontab -l' and view the listing I don't see the cron I entered in the text editor.

I'm a newbie so everything I'm doing is informed by Google search so I expected crontab to open in vim. Could someone explain: Why is it opening in a GUI text editor? How do I get it to save?

Thank you
 
Old 06-29-2020, 10:47 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 20,105

Rep: Reputation: 3381Reputation: 3381Reputation: 3381Reputation: 3381Reputation: 3381Reputation: 3381Reputation: 3381Reputation: 3381Reputation: 3381Reputation: 3381Reputation: 3381
Welcome to LinuxQuestions.

While the default editor is vim it can be changed but we need to know what editor is actually running.

Last edited by michaelk; 06-29-2020 at 10:53 AM.
 
1 members found this post helpful.
Old 06-29-2020, 10:55 AM   #3
shruggy
Member
 
Registered: Mar 2020
Posts: 994

Rep: Reputation: Disabled
Well, crontab -e first tries $VISUAL, then $EDITOR, and then, if both of them unset, starts /usr/bin/vi. So that GUI editor must be set either in VISUAL or in EDITOR.
 
1 members found this post helpful.
Old 06-29-2020, 11:14 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,834

Rep: Reputation: 6325Reputation: 6325Reputation: 6325Reputation: 6325Reputation: 6325Reputation: 6325Reputation: 6325Reputation: 6325Reputation: 6325Reputation: 6325Reputation: 6325
Quote:
Originally Posted by rakeshmanmohan View Post
My employer purchased a desktop PC with a custom Linux installation, CentOS 6.9. The vendor is not providing any support. On this desktop I am trying to automate a simple script I created using crontab, strangely, whenever I run the command 'crontab -e' it opens in a GUI text editor.

I enter the cron job I need, click the save button on the text editor and close it, however, when I run 'crontab -l' and view the listing I don't see the cron I entered in the text editor. I'm a newbie so everything I'm doing is informed by Google search so I expected crontab to open in vim. Could someone explain: Why is it opening in a GUI text editor? How do I get it to save?
You don't say which GUI text editor is opening, so we can't tell you how to save it when you're done. However, you can look in your .profile or .bashrc files for the $EDITOR and $VISUAL environment variables. If they're not set there, look in /etc/profile, and change it to be whatever you'd like. I *THINK* (don't remember exactly) that if you remove those variables, it will default to vi, but I'm not 100% sure of that.

Besides all that, though, I'm not surprised your vendor isn't providing help...CentOS 6.9 is VERY old:
https://wiki.centos.org/About/Product

If these are new PC's, I'd sure want to know why they provided such an old OS that's going to be TOTALLY out of support (as in, ZERO updates/fixes) as of this year.
 
1 members found this post helpful.
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot editor crontab unless I explicitly set the EDITOR vincix Linux - Newbie 16 06-27-2019 06:41 AM
gdrive from crontab does'nt work , shell is ok from command line but failed from crontab sazdovskij Linux - Newbie 3 05-20-2019 12:25 PM
What can be more simpler than a GUI based Text editor to start an open source project ? TheIndependentAquarius General 19 11-23-2010 02:11 AM
Command-line output to GUI text editor hex1a4 Linux - General 2 04-10-2008 11:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration