Solved

AIX Crontab NULLED

Posted on 2014-02-28
7
516 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

762 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