Crontab refuses to save changes!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Crontab refuses to save changes!
# 1  
Old 03-09-2005
Network Crontab refuses to save changes!

I'm trying to create a new crontab entry for a user on a debian box but whenever I do a crontab -e or crontab -u username -e then edit the crontab (with vim as my default editor) and :wq. I get the error message:

no crontab for username - using an empty one
crontab: no changes made to crontab

I've tried editing as both the user and as root and have the same problem. I've also tried editing the root crontab and have the same problem. Crontab just doesn't want to play nice on this machine (I've tried it on another debian box and its all fine).

The entry I'm trying to add is:

0,15,30,45 * * * * php /home/username/sandbox/X/xxxx/codebase/bin/client.php all

and I've added a blank line after it as I read somewhere that not having it may cause problems.

Anyone got any ideas?

So far I've checked permissions of /var/spool/cron and /var/spool/crontabs, and they are the same on both machines.

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.

I'm at a loss here, any help gratefully received.
# 2  
Old 03-09-2005
Check the contents of /etc/cron.allow and /etc/cron.deny. Also check the log file for cron (default is /var/log/cron.log I believe - check /etc/syslog.conf to see if it's changed).
# 3  
Old 03-09-2005
Thanks for the response RTM.

I forgot to mention before that I had checked for both /etc/cron.allow and /etc/cron.deny, neither of which exist. The man page for crontab doesn't seem to think that would be a problem tho. (Quoted for others who might have this problem):

"If the /etc/cron.allow file exists, then you must be listed therein in order to be allowed to use this command. If the /etc/cron.allow file does not exist but the /etc/cron.deny file does exist, then you must not be listed in the /etc/cron.deny file in order to use this command. If neither of these files exists, then depending on site-dependent configuration parameters, only the super user will be allowed to use this command, or all users will be able to use this command. For standard Debian systems, all users may use this command."

For some reason cron logging had been commented out in syslog.conf so after de-commenting it:

Code:
Mar  9 14:49:27 hostname crontab[10627]: (root) BEGIN EDIT (username)
Mar  9 14:49:58 hostname crontab[10627]: (root) END EDIT (username)

Can't see anything wrong there. Any other ideas?
# 4  
Old 03-09-2005
I know this may sound dumb but did you check the permission on the crontab file. Even if you are root you can't write to a file that doesn't have writ permission. Sometime we often over look the simple thing. Smilie
# 5  
Old 03-10-2005
Good point larryase. I had had a look at the permissions on the crontab files but not the binary itself. Anyway this is what I got on /usr/bin/crontab:

Code:
# ls -l /usr/bin/crontab 
-rwsr-xr-x    1 root     root        22460 Oct  1  2001 /usr/bin/crontab

Not sure what the 's' in the owner permissions is about?!?

I tried chmodding it to 755 but I'm still getting the same problem.
# 6  
Old 03-10-2005
The -rws is the set-user-ID (or set-group-ID if it's in the group) bit - see the man pages for ls and chmod (by the way, you need it on there).

As far as your original problem, check your permissions on the directories above where the crontab files are - to make sure you can create or change files, try creating a new file in the directory (touch justsomejunkfile) and then delete it if it does get created (as cron won't like it being there).

See if you can find documentation for your OS as far as the permissions set for the directories and crontab files.
# 7  
Old 03-24-2005
Willy

I had this same problem, I looked the the disk free space and found that /var was at 100% I went into /var/log and cleaned out some old logs and the problem went away. Try command: "df -k"
 
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