Solved

AIX Crontab NULLED

Posted on 2014-02-28
7
511 Views
Last Modified: 2014-02-28
As root on an AIX server a user ran a command "crontab" and pressed enter. As soon after he did this he did a "Ctrl z", This seems to have nulled the root crontab file. Is this possible, What is the explanation behind this.

I replicated the issue on a different server but root crontab entries were intact. So just by running "crontab" will this null the file, as I know that "crontab -e" does editing of crontab, "-e" option was not specified.
0
Comment
Question by:aanya247
  • 3
  • 3
7 Comments
 

Author Comment

by:aanya247
ID: 39894914
$ crontab
[1] + Stopped (SIGTSTP)        crontab
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 300 total points
ID: 39894937
crontab alone opens an empty file for editing. Upon exit this file overwrites the original crontab.

ctrl-z alone cannot null a file. The user must have issued a write command, such as ":wq" or ":x" or "ZZ".

Could it be that it wasn't "ctrl-z" but "shift-zz"?
0
 
LVL 5

Assisted Solution

by:Dave Gould
Dave Gould earned 200 total points
ID: 39895109
ctrl-z just suspends the vi process. If the user types "jobs" he should see that the process is still there and can bring it back to the foreground by typing fg.
This should bring him back to the vi process which he can simply force quit (:q!)

It is possible that this advice is a bit late if the user has already logged out.
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:aanya247
ID: 39895222
Its Too late now... :) thank you that is something which I did not think.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39895238
ctrl-z alone will never destroy a file, I keep telling you.

Test: Issue "crontab", then hit ctrl-z, then issue "exit" twice.
Log in again and you will find the crontab unchanged.

And are you aware that "crontab -r" will delete the crontab without asking for confirmation?
0
 

Author Comment

by:aanya247
ID: 39895317
Wmp
Ur solutions are very valuable and I learn a lot from them, I understood from the first comment that Ctrl Z, will not delete but I never knew that jobs is a command that can be run to find out.

So I am sorry for the distribution of points and I know that ur first comment solved my question .

Thanks again
Aanya
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39895351
Never mind, I'm always glad to help, regardless of the points.

Thx for them!

wmp
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Bad Block Relocation for Synchronous GLVM AIX 7.1 2 70
Move nodes from one TSM to another. 3 73
aix tls version 6 312
remove one line from a file in solaris 8 28
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question