SlackwareThis Forum is for the discussion of Slackware Linux.
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.
I'm trying to change and add command to my crontab file. when i do:
Code:
crontab -e root
it takes me to a file so i can edit and change. Then i go and change something, save it, and quit. but when i go back into the crontab none of my setting were saved. How can i edit crontab so that my changes are saved?????? Also i like using vim better than vi, how do i change the VISUAL variable to vim permittedly???? so i don't have to type:
To change to vim add export VISUAL=vim somewhere in /etc/profile so changes will be global.
Strange, my cron is not working now... I'll check this out
Edit: This is strange, if I use vim as VISUAL it won't let me update but it will do if I use mcedit, I really don't get it. However I can use vim to edit crontab with my user without problems, the problem is with root.
here are my exact steps, (am i doing something wrong)
i'm logged on as root
Code:
$>crontab -e root
# If you don't want the output of a cron job mailed to you, you have to direct
# any output to /dev/null. We'll do this here since these jobs should run
# properly on a newly installed system, but if they don't the average newbie
# might get quite perplexed about getting strange mail every 5 minutes. :^)
#
# Run the hourly, daily, weekly, and monthly cron jobs.
# Jobs that need different timing may be entered into the crontab as before,
# but most really don't need greater granularity than this. If the exact
# times of the hourly, daily, weekly, and monthly cron jobs do not suit your
# needs, feel free to adjust them.
#
# Run hourly cron jobs at 47 minutes after the hour:
47 * * * * /usr/bin/run-parts /etc/cron.hourly 1> /dev/null
#
# Run daily cron jobs at 4:40 every day:
40 4 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null
#
# Run weekly cron jobs at 4:30 on the first day of the week:
30 4 * * 0 /usr/bin/run-parts /etc/cron.weekly 1> /dev/null
#
# Run monthly cron jobs at 4:20 on the first day of the month:
20 4 1 * * /usr/bin/run-parts /etc/cron.monthly 1> /dev/null
I change a few things and when i open crontab -e root everything i back to normal.
About crontab, you seem to all be missing the part where /etc/cron.* directories exist. If you want to run something daily, hourly, weekly, monthly, etc. just create a script, make it executable, and link it in /etc/cron.X. No need to edit crontab, unless you want something that isn't already set up.
As for the "visual" variable, just put the export command mentionned above somewhere in /etc/profile.d.
Try using VIM again but when you get to the program try issuing the command 'set compatible' first before you do the editing. ( you can issue this command by pressing : ( colon ) then typing set compatible and hitting enter )
once that has been done and the file saved and vim quit you should find that when issuing a crontab -l that the new bits you just put in are there.
About crontab, you seem to all be missing the part where /etc/cron.* directories exist. If you want to run something daily, hourly, weekly, monthly, etc. just create a script, make it executable, and link it in /etc/cron.X. No need to edit crontab, unless you want something that isn't already set up.
killerbob, that works, but if you want to adjust the time and or add more flexibilty to crantabd you MUST edit teh crontab directly.
antken, thanks for the link and strace. straces is a very powerful program at times.
thanks,
djgeravor3
Last edited by djgerbavore; 05-30-2005 at 09:25 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.