URGENT: restore a delete file!

sminfo
sminfo used Ask the Experts™
on
I've just delete a script.ksh on my aix. Is there a way to restore it again

thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
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!
Most Valuable Expert 2013
Top Expert 2013
Commented:
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

Author

Commented:
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
Most Valuable Expert 2013
Top Expert 2013

Commented:
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
 

Author

Commented:
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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial