Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
hi im trying to set up cron to execute a script every minute but im confused about the process. I read about the format of the crontab so im famialar with that. I read you can do crontab -e to edit your crontab but it defaults to vi. I tried to do export VISUAL='emacs" and that works but whenever i close out the shell and re-enter and try crontab -e again it goes back to opening it in vi. Is there a way to set it to emacs and have it stick? this is my crontab in /etc/
when i first tried to do crontab -e it said i had a empty one for user so i tried creating one just adding the last line of the above crontab. this is what i get when i do crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.32647 installed on Tue Apr 12 16:58:38 2005)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
58 * * * * jeff /home/jeff/appointmentreminder.sh
would i need to copy the SHELL, PATH, etc into that crontab as well for it to work? Any help would be appreciated. thanks in advanced.
i forgot to change that. When i was testing it out i set it up to run the script the next minute. i did crontab /etc/crontab/ and that set it up right. doing the export EDITOR=emacs didn't work out for me it still opens up vi. in ps -A cron should be crond right? Cuz i thought maybe it wasn't starting because cron hadn't started.
that still didn't work. i don't know if i have a certain version of cron/crontab because some of the cron related files i have weren't mentioned in some of the sites i read about cront/crontab. This is the output of ls /etc/ | grep cron
There was a similar message. The questioner wanted to know how to get 'crontab -e' to use vi instead of ed.
The response was to get out of the habit of using 'crontab -e' because a slip-up could wipe out your crontab can cause all sorts of unpleasantness. He recommended:
Quote:
Far safer is to use "crontab -l > somefile; vi somefile"
and then, if everything is to your liking, "crontab somefile"
thanks. yeah when i did use crontab -e i did have a sketchy feeling. I read another article about crontab and it says to add the scripts to the cron.weekly, cron.hourly, etc but then i don't understand how you'd find tune the extact time for each job. Or do you have to add it in that folder and the crontab entry fine tunes the time?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.