Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


URGENT: restore a delete file!

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

Question by:sminfo
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

Author Comment

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!
LVL 68

Accepted Solution

woolmilkporc earned 2000 total points
ID: 33211539
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!

Author Closing Comment

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
LVL 68

Expert Comment

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?

Author Comment

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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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.
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.
Suggested Courses

636 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