Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Edit Cron Job

Posted on 2006-06-29
7
Medium Priority
?
534 Views
Last Modified: 2010-04-20
Hi there

Dont know too much linux.

I want to add a new cron job to a currently running one. I found where it is stored: /var/spool/cron.

However when I try to edit it using 'vi' it tells me:

DO NOT EDIT THIS FILE - edit the master and reinstall.

Can I edit it? If not how do I go about doing it.

Many Thanks
0
Comment
Question by:AndriesKeun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 22

Expert Comment

by:pjedmond
ID: 17008996
crontab -e

and you'll end up editing your crontab:)
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17009000
Guess you ought to read:

man crontab

as well:)

(   (()
(`-' _\       It's supposed to be a mouse!
 ''  ''
0
 

Author Comment

by:AndriesKeun
ID: 17009037
when i use crontab -e i also get the message: DO NOT EDIT THIS FILE - edit the master and reinstall.

in the directory: /var/spool/cron. there are a couple of files, one of which when i edit it there are two jobs in there, and i know for certain that these jobs run, however when i use crontab -e there are 5 jobs there, and the two that i know run are not in there. so you see, im a bit confused?



0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

Author Comment

by:AndriesKeun
ID: 17009128
sorry, my mistake, i just switched user.

but I still get the message: DO NOT EDIT THIS FILE - edit the master and reinstall. when i use cronatab -e, so yes or no answer, Is it cool if i edit this file? I cant afford to stuff it up.
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 500 total points
ID: 17009138
OK - looks like you have edited the wrong bits, and the system is now confused about which are the master files!

Setup should have crontabs in the:

/var/spool/cron/ folder as you have alluded to. There should be one for root, one for each user that uses cron, and probably a 'temporary' crontab which I believe is part of the cron calculating and optimisation process.

When you edit your crontab, you should *ONLY* do it via crontab! If you edited the /var/spool/crontab/user file then date/times will have become messed up. You need to edit your crontab, using:

crontab -e

This will edit your crontab. By saving this, I think that the date/times should be re-aligned and stop giving you the aforementioned error.

(   (()
(`-' _\
 ''  ''
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17009145
Yes - using "crontab -e" is the correct way to edit your user crontab.

(   (()
(`-' _\
 ''  ''
0
 

Author Comment

by:AndriesKeun
ID: 17009342
perferct, thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question