Gossamer Forum
Home : General : Internet Technologies :

Seriously big UGH

Quote Reply
Seriously big UGH
I was trying to delete a specific file using rm -rf and, well, forgot to type in the file name and kinda nuked /usr/local/lib

If anyone has any restoration ideas then I'm all ears Wink

Last edited by:

Paul: Oct 16, 2002, 7:19 AM
Quote Reply
Re: [Paul] Seriously big UGH In reply to
Yeah, look or your backups. Oh, you don't do backups, well now then, that's silly .... ;-)

Try your rescue.bin diskette -- what linux distro is this?

- wil
Quote Reply
Re: [Paul] Seriously big UGH In reply to
I was playing around with this the other day, really quite neat:

http://www.m-arriaga.net/software/libtrash/

Won't help you now, but definitely useful. =)

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Seriously big UGH In reply to
Looks interesting. I was just about to install but read some things in the readme about it screwing up bootup/shutdown as it stops files being overwritten.

I will keep it bookmarked.

Regarding the other blunder, a friend of mine has an almost identical system to me (thank the lord!) and so he let me wget 100MB of libs back to my server and it pretty much fixed everything. I just had to play about with the GD libs which were causing libphp4.so to spew when starting apache.

My backup script backs up practically everything except /usr/local/lib ....guess what I'll be doing later tonight (re-writing it).
Quote Reply
Re: [Paul] Seriously big UGH In reply to
What linux distro you running there? What method are you using to install applications? apt and rpm will install all dependencies and check for broken dependencies on your system, which would of recovered most of your lib files.

Cheers

- wil
Quote Reply
Re: [Paul] Seriously big UGH In reply to
Do it the other way, all you do is install it as root (which doesn't activate anything), and then in your ~/.bash_profile file add:

export LD_PRELOAD=/usr/local/lib/libtrash.so.1

if that environment variable is not set, then it is not active. If it is set, then it is active. Makes it easy to turn on and off per account, and won't mess up your system startup/stop as it's only active during shell sessions.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Seriously big UGH In reply to
Thanks, I'll try that and see how it goes.
Quote Reply
Re: [Alex] Seriously big UGH In reply to
This is nice too...


alias trash_on="export TRASH_OFF=NO"
alias trash_off="export TRASH_OFF=YES"
Quote Reply
Re: [Alex] Seriously big UGH In reply to
That's cool Alex, thanks for pointing me towards that site, it works great. I cleared out /root and installed libtrash and edited .bash_profile and then did:

touch foo
rm -rf foo

...and a trash can appeared with foo in it....sweet!

Last edited by:

Paul: Oct 16, 2002, 2:26 PM
Quote Reply
Re: [Paul] Seriously big UGH In reply to
The really cool thing is no matter how you delete it (rm foo, perl -e 'unlink "foo"', etc), the trash can catches it. You can also have it catch files if you open them in write mode (for instance you do a `cat foo > log` instead of `cat foo >> log`. See the docs as I don't think this is enabled by default.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Seriously big UGH In reply to
Yeah the only thing I can't seem to get to work is the SHOULD_WARN option. I've created a custom .libtrash file in /root with:

SHOULD_WARN=YES

...then I turned off the trash can but it doesn't show me a warning :(