Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 499
  • Last Modified:

replace ROOT crontab

What file is it that keeps the ROOT cron jobs, I need to replace the current crontab for root with a new one instead of just editing it.

Thanks,
0
bt707
Asked:
bt707
  • 3
  • 2
1 Solution
 
jkrCommented:
Just log on as root and type

crontab -e

to change it.
0
 
bt707Author Commented:
yes I know how to edit it via crontab -e, so I could open it via crontab -e then delete everything then past all the contents from the one I have but thought there would be a way to replace the file itself?

We currently keep files such as this in CVS update them then do a checkout on the server then replace the files.

Isn't there a file I could just overright with the new updated crontab we have in CVS?

Thanks,

0
 
bt707Author Commented:
I did find out the crontab can be replaced via # crontab (with no options)

so

cat file.txt | crontab

0
 
jkrCommented:
The locatiojn of crontab will depend on your system, take a look at /var/spool/crontab (which is one common location). You should easily be able to locate it by applying some minor change and then issue

find / -mmin 2 -print

which will list all files that were modified up to 2 mins ago.
0
 
jkrCommented:
Ooops, race condition ;o)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now