The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
script in saved in compress format naveeng.81 Shell Programming and Scripting 1 04-14-2008 08:31 AM
Sudo file not saved Asteroid UNIX for Advanced & Expert Users 0 07-30-2007 07:18 AM
Where are the password saved in a UNIX server? hast5 UNIX for Dummies Questions & Answers 12 10-19-2006 04:11 PM
How to change root's .profile settings FredSmith UNIX for Dummies Questions & Answers 1 08-07-2006 02:57 PM
SunOS - root's .profile xadamz23 UNIX for Dummies Questions & Answers 3 08-08-2003 03:40 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-20-2007
flok's Avatar
flok flok is offline
Registered User
  
 

Join Date: Jun 2007
Location: Gouda, The Netherlands
Posts: 1
only root's crontab gets not saved

Hi,

Something funny is happening over here: when a regular user edits his cron-file (crontab -e) saves and exits vi the correct new cron-file gets installed and saved to disk. But if root does the same, vi saves it but if I then check the cron-file it has the previous contents! I did strace (== truss on other platforms) and I see the following (edited for brievety):
chdir("/var/spool/cron/crontabs") = 0
open("/var/spool/cron/crontab.8195", O_RDWR|O_CREAT|O_TRUNC|O_EXCL, 0600) = 3
chown32("/var/spool/cron/crontab.8195", 0, 0) = 0
open("root", O_RDONLY) = 4
/* fd 4 (original cron file) gets copied to fd 3, then vi gets invoked on crontab.8195 */
/* vi exits */
unlink("/var/spool/cron/crontab.8195") = 0
lseek(3, 0, SEEK_SET) = 0
open("root.new", O_WRONLY|O_APPEND|O_CREAT|O_TRUNC, 0600) = 5
/* copies fd 3 to fd 5
rename("root.new", "root") = 0

So things DO get editted and written correctly but still the output-file is the original?!
crontab version 2.3.3
dcron version 2.3.3
Linux system.
  #2 (permalink)  
Old 06-25-2007
Peterh Peterh is offline
Registered User
  
 

Join Date: Feb 2001
Location: Frankfurt Germany
Posts: 61
Hi

Tip I can give you is from SunSolaris, I allways create crontab file and edit it with vi and then activate it.

crontab -l > root.crontab

vi root.crontab

(Do your changes)

crontab -r

crontab root.crontab

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0