Crontab refuses to save changes!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Crontab refuses to save changes!
# 15  
Old 04-08-2005
My preference is not to use that method of editing the crontab. I prefer to save it to a file then edit then upload it again. That way I also have a local copy.

# crontab -l > crontab.out
# vim crontab.out
# crontab crontab.out

I really dont like direct edit of the crontab, esp at work if anything should go wrong I will have corrupted it or worse delete it.
# 16  
Old 04-08-2005
Hmmm.

I can't answer or help but to add that I always update or change (edit) crontab files with vi and have never had a problem.
# 17  
Old 04-08-2005
Quote:
Originally Posted by Kelam_Magnus

I really dont like direct edit of the crontab, esp at work if anything should go wrong I will have corrupted it or worse delete it.
..... the solution is simple.

cp crontab crontab.working

vi crontab

If it does not work, you always have crontab.working Smilie
# 18  
Old 04-10-2005
My comment you quoted was for using crontab -e... not with vi... I too use vi...
# 19  
Old 04-25-2005
Quote:
Originally Posted by fire>ant>
...
My editor is set to /usr/bin/vi (which is a symlink to vim). The only other thing of note is that on this, for some reason /tmp has been symlinked to /var/www/tmp (its one of our web dev servers) but the permissions seem fine on that directory.
...
For some reason the combination of vi and the /tmp being linked to /var/www/tmp is what is causing the problem. I have a system that exhibits the same problem, using vi with a linked /tmp directory and the 'crontab -e' command refuses to update my cron entries for any user. I then definied two environment variables:

TMP=/var/www/tmp
TEMP=/var/www/tmp

and exported them, and now 'crontab -e' works fine with vi! Seems that either vi or crontab needs to know where your /tmp folder actually lives, since it does not seem to figure it out from the symbolic link from /tmp to /var/www/tmp.

Also, the command 'crontab -e' really is the best way to update your cron entries since this command actually edits a copy of you cron table (hence the need to define your real /tmp folder), and when you are done editing that copy, cron then parses your edits for syntax problems, and if everything looks fine it places your new crontab in place of the old. If there are any problems, it will let you know and give you a chance to make further edits.

Hope this helps everyone!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

A function that refuses to run anywhere else but main()

Hi. I have some code, that for some reason, I could not post it here in this post. Here's the address for it: #if 0 shc Version 4.0.1, Generic Shell Script Compiler GNU GPL Version 3 Md - Pastebin.com First off, I used "shc" to convert the code from shell script to C. And The... (6 Replies)
Discussion started by: ignatius
6 Replies

2. Shell Programming and Scripting

Save value from output of Corestat and save in a list for each core

I am trying to modify the "corestat v1.1" code which is in Perl.The typical output of this code is below: Core Utilization CoreId %Usr %Sys %Total ------ ----- ----- ------ 5 4.91 0.01 4.92 6 0.06 ... (0 Replies)
Discussion started by: Zam_1234
0 Replies

3. UNIX for Dummies Questions & Answers

Auto load and save crontab

Hi all, I am trying to simplify things for two people who will be taking over my role whilst i go on leave. In doing so, i wanted to find a way that upon login to unix, the crontab would be reloaddd and resaved. I want to do this due to our IT dept taking the server down more often of late... (5 Replies)
Discussion started by: KlintJ
5 Replies

4. Ubuntu

How to save crontab?

How to save crontab? I have try both method below but can't save it. FIRST METHOD error message hit 'escape' and then the following: :wq http://i.imgur.com/nY2YI.jpg SECOND METHOD error message ctrl + s http://i.imgur.com/ECzl0.jpg (3 Replies)
Discussion started by: mampwamp
3 Replies

5. Solaris

Sendmail refuses to send via relay

Hi I have two realtively identical Solaris zones. They both appear to have the same config in relation to sendmail. But, when I send a test email using mailx the first one sends via a mail relay and the other sends via localhost. I need them both to use the relay but can't figure out what is... (0 Replies)
Discussion started by: gregb
0 Replies

6. UNIX for Advanced & Expert Users

Virtual CDROM refuses to quit

Good day. I have a Sun Netra X4200 M2 server with AMI BIOS. When I performed a iostat -En, I noticed that the AMI Virtual CDROM had taken device id c0t0d0, however, I need c0t0d0 for the real CD/DVD device. So, I disabled the Virtual CDROM in the BIOS and rebooted. Lo and behold, the... (0 Replies)
Discussion started by: BRH
0 Replies

7. Linux

How to save crontab configuration when using SSH?

Hi, I'm trying to save a crontab configuration using SSH, acessing a Linux machine from a Windows desktop. So, in the prompt I type "crontab -e", to edit crontab, and a window is opened. But after writing the changes, I press Save button but it seems not working, because when... (1 Reply)
Discussion started by: Roger75
1 Replies

8. UNIX for Dummies Questions & Answers

can't save crontab with vi

I edit crontab with vi editor, i delete the lines i wanted, but i can't save! i tried the :w, :wq, ZZ commands and it seems like vi is unfamiliar with it. any suggestions? (3 Replies)
Discussion started by: idan_cn
3 Replies

9. Shell Programming and Scripting

how to save crontab

how does one save changes in crontab? i am using vi editor. Issued crontab -e command on the prompt. however not sure how to save changes. :wq doesnt work. any idea.... (10 Replies)
Discussion started by: shahab03
10 Replies

10. UNIX for Dummies Questions & Answers

.netrc refuses password

Hi trying to ftp a printer to collect info but the ftp file shows that when it gets to password the mode is incorrect both the login and the password are not compulsory (e.g. if the user hits the enter button twice the ftp session is initiated) any ideas :confused: (6 Replies)
Discussion started by: w33man
6 Replies
Login or Register to Ask a Question