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
Solved

AIX Crontab NULLED

Posted on 2014-02-28
7
513 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

856 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