Thanks for your suggestions guys, sorry for the radio silence, been on holiday up in the mountains and hence arguing with crontab wasn't at the top of my to do list. Anyway back to it...
I've checked the disk usage and there's no problems there.
I've compared the permissions on the existing /var/spool/cron/crontabs/root file (so it must have worked at some point) and the enclosing directories with another more co-operative machine and can find no differences.
cat-ing the root crontab gives:
I can touch a file matching my username (as root) in /var/spool/cron/crontabs/ but not under my user account (same behaviour as on the other machine) which I've then 600-ed and root.users-ed to match the permissions on the other machine.
Running:
and then cat-ing the file reveals that it has been populated with the cron header:
But still crontab -u username -e results in the same error message and the changes not being written to the file.
As for finding documentation for permissions for my OS (debian), I've checked out the man pages for cron and crontab but I'll hunt the web for more info, any suggestions? Also it does talk about making sure that the editor edits the file in place and does not make a copy. I'm using vim which I would have thought wouldn't be a problem but when editing my crontab using a crontab -u username -e does show "/tmp/crontab.XXXX2qwBiu" in the status bar. Although the other machine which plays nice also exhibits this behaviour.
My inkling that the problem may lie with vim seems to have some legs. Temporarily changing the $EDITOR environment variable to /usr/bin/nano and then doing the crontab edit did the job. No more error message and crontab -u username -l reports that the changes were saved successfully. Oh the joy.
Anyone know what vim's problem is? I personally think its just looking for a slap but any other solutions more technical in nature would be gratefully received.
Cheers Ice, just missed your post before posting my last. Thanks for the reply, I've found a workaround now tho. Its not perfect but it gets the job done, any idea why vim doesn't want to play nice with crontab?
Just curious what version of vim you are using? We aren't using the latest one atm, just lazy I guess. We are still on version 5.7.2001-06-12
http://www.vim.org/ You might try the latest version if you are not on it right now.
Also, you can directly edit the crontab file which I suspect you are doing now, but you didnt mention... mine are in /var/spool/cron/crontabs.... hpux.
I'm using vim version 6.1.18, which isn't that old and its the latest available using apt-get.
No, I didn't directly edit the crontab when I got it working, I just temporarily changed the EDITOR environment variable from /usr/bin/vim to /usr/bin/nano and then did a crontab -u username -e.
Having just done a quick google on 'crontab vim' I came across this thread which might have something to do with it. Next time I need to play with crontab, I'll see if .vimrc is causing the problem.
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)