Why Does Crontab -e Command Open In GUI Text Editor?
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.