Solved

URGENT: restore a delete file!

Posted on 2010-07-15
5
1,361 Views
Last Modified: 2013-11-17
I've just delete a script.ksh on my aix. Is there a way to restore it again

thanks
0
Comment
Question by:sminfo
[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
  • 2
5 Comments
 

Author Comment

by:sminfo
ID: 33211499
weell, I really make an  error when doing a link, so it delete the script.. the script.ksh is now a link instead a file... damn!
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 33211539
Hi,
I assume you don't have a current backup? And I assume you deleted the file using "rm" at the commandline (not the graphical "dtfile" or the like)?
If so, and if you actually don't have a backup, things are going to get really complicated or expensive, because AIX has no straightforward mechanism to recover deleted files.
There is a company offering a commercial undelete product for AIX - http://www.compunix.com/prod/analyse.html
Prices go from 2.500 EUR to 4500 EUR.
You can try it using by yourself the filesystem debugger "fsdb". It's awfully complicated, but will work in most cases, given that you follow accurately the steps outlined in this paper - http://www.faqs.org/faqs/aix-faq/part1/section-54.html
Note that you will have to umount the filesystem! If this is not possible, you're lost!
Alas the above article deals with legacy jfs. There are some differences in fsdb when it comes to jfs2. Consult the section "JFS2" subcommands" in "man fsdb" to learn about these differences, if some command mentioned in the article doesn't work as expected.
 Please let me know what you're going to do and don't hesitate to ask for assistance!
 Good luck!
 wmp
0
 

Author Closing Comment

by:sminfo
ID: 33213305
well.. I had to make again the script, I had luck because I try  to split scripts regarding it functionality, so I delete the main.ksh.  let me ask you some questions:

- Is there a tool similar to monit in aix?
- Is there a tool to clean temp  unused files and cores files?
- I see rpm is install on my system, is this rpm similar to redhat's? Where can I find aix'rpms files? Can I install a rpm file dependencies like redhat's yum does?
-Is any mail cliente for console similar mutt, or pine in aix?
-last, (for now :-), I have to install mysql, is mysql part of aix, or I have to compile it?

thanks wmp
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 33213548
1) No. For processes started via "inittab" at system startup you can set the "respawn" flag to have them restarted after a failure. That's all, and I'm not aware of a monit port to AIX either.
2) Yes. It's /usr/sbin/skulker, a script from IBM to clean up spool files, old mailq entries, /tmp and /var/tmp stuff, news, core files etc. There is already an entry for it in root's crontab which you only need to uncomment.
3) Yes, rpm is a port of redhat's rpm to AIX. The main repository for AIX RPMs is the AIX toolbox which comes on CD with the OS, and whose contents can be downloaded here -  http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/download.html
There is another great source for AIX RPMs here - http://www.perzl.org/aix/ 
3a) You will have to live with RPM's dependency hell, unfortunately.
4) There is mutt and there is pine in the AIX toolbox (see above). I'd recommend mutt, because pine has too many dependencies, imho.
5) No, mysql is not part of AIX. There is a version on the toolbox, but only 3.23.58. Newer versions must be compiled. GCC and friends are available on the toolbox and at perzl.org.
Thx for the points! Glad to hear that you could recreate your work. fsdb is really horrible, a true last resort.
How about regular backups in the future?
Cheers
wmp
 
0
 

Author Comment

by:sminfo
ID: 33214142
We have backups here, I deleted a personal rbac script when moving from one side to another. Fortunately I was the only affected. This script calls other 10 scripts which are separately in the same folder. I have to backup my scripts... thanks 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

Suggested Solutions

Title # Comments Views Activity
FTP on FreeBSD server 2 167
ftpcommand 2 82
Parsing a file using ksh 10 82
Writing a UNIX script menu allowing for multiple options. 5 101
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.
Suggested Courses

751 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