Re: [opensuse] Undoing a delete

2007-11-29 Thread Carl Spitzer
On Sat, 2007-11-17 at 16:40 -0600, Bryen wrote:
> Is there any way to undo an rm in terminal?  Probably not, but thought
> I'd ask...
> 
> 
> -- 
> ---Bryen---

#!/bin/sh
#
#MoveWithPWD
#You must translate the slash or the move will fail.
#
MyPWD=`echo $PWD | tr '/' '-'`
#echo $MyPWD
#
#In the for loop you specify the files you wish this gets them all
#See man ls
#
for i in `ls -A`; do
   mv -v $i /home//.Trash/$MyPWD.$i;
done





to list the files if you choose minus for the translation of the /
The double dash must be after the minus l in order for the command
to know to handle files starting with a minus.


ls -l  -- -*
-rw---  1 cwsiv users 15416571 2007-11-29 16:26
-home-cwsiv-test.dummy.07
-rw---  1 cwsiv users  7771751 2007-11-29 16:26
-home-cwsiv-test.dummy.071112
-rw---  1 cwsiv users  9933056 2007-11-29 16:26
-home-cwsiv-test.dummy.071113
-rw---  1 cwsiv users  8629139 2007-11-29 16:26
-home-cwsiv-test.dummy.071114
-rw---  1 cwsiv users 11471762 2007-11-29 16:26
-home-cwsiv-test.dummy.071115
-rw---  1 cwsiv users  9405675 2007-11-29 16:26
-home-cwsiv-test.dummy.071116


All my scripts started as other peoples ideas modified many times for my
own needs.  This is the best I could do on short notice.  Of course you
will have to put this under some directory on your user and make a alias
for rm in either dot profile or dot bashrc referring to this script.

So now you have your first script enjoy it in good health and have some
fun with it, on test data.  

Likely someone here will provide you a reversal script for restoring
single files from .Trash to their original locations.



 ___ _ _ _  _ _  _
|| | | [__  | |  |
|___ |_|_| ___] |  \/
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-29 Thread Carl Spitzer
On Sat, 2007-11-17 at 15:53 -0800, Randall R Schulz wrote:
> On Saturday 17 November 2007 15:41, Bryen wrote:
> > On Sat, 2007-11-17 at 15:30 -0800, Randall R Schulz wrote:
> > > ...
> >
> > > I've known users (dare I say, "lusers") to override rm with a
> > > script that moves the target files to a trashcan folder.
> >
> > Hmm... That would be an interesting project to try to create.  What a
> > way for me to flex my current knowledge and expand on it.  :-)
> 
> It's no big deal. Write an "rm" replacement script that moves files to a 
> specified trash folder rather than simply unlink them. The only thing 
> you really have to worry about is name clashes. When that happens, add 
> a suffix (making sure that the suffix is unique, of course). With a bit 
> more work, you could additionally mimic the file system hierarchy 
> within the trash folder, but that doesn't get you out of handling 
> multiple deletes of the same name (since files often get recreated 
> after they're deleted).
> 
Here is an easy bash script one dates files the other takes a prefix.
change cp to mv and pick your target directory.  With command pwd you
get the present working directory so if you later go to your trash
directory you can read where the file came from.

cat CopyWithDate.sh
#!/bin/sh
for i in `ls -A`; do
   cp -v $i /home/cwsiv/Documents/$(date +%F).$i;
done

cat CopyWithPrefix.sh
#!/bin/sh
echo Needs detection for empty string
if [$1=""]; then
  echo Provide a Prefix to be used
fi
#for i in `ls -A`; do
#   cp -v $i /home/cwsiv/Documents/$1.$i;
#done
 


 ___ _ _ _  _ _  _
|| | | [__  | |  |
|___ |_|_| ___] |  \/ 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-29 Thread Carl Spitzer
On Sat, 2007-11-17 at 18:51 -0500, Patrick Shanahan wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> * Bryen <[EMAIL PROTECTED]> [11-17-07 18:44]:
> > 
> > You'd think, since I googled and see enough people have done this same
> > thing accidentally, that a trashcan folder would be standard.  Oh
> > well...
> 
> there is and it is, but that is a graphical thing and *can* be
> bypassed, but it does not save you from command line rm.
> 
> a deterrent, alias rm='/bin/rm -i'
> 
> 
Shouldn't that be in dot profile or dot bashrc so it persists between konsole 
secessions?


 ___ _ _ _  _ _  _
|| | | [__  | |  |
|___ |_|_| ___] |  \/

 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-19 Thread Hans van der Merwe

On Sat, 2007-11-17 at 16:40 -0600, Bryen wrote:
> Is there any way to undo an rm in terminal?  Probably not, but thought
> I'd ask...
> 
> 
> -- 
> ---Bryen---
> 

Depending on what you want to recover the following worked for me - to
recover images I deleted from a USB flashdisk (will do other file
formats as well)

http://www.cgsecurity.org/wiki/PhotoRec




E-mail Disclaimer
http://www.sunspace.co.za/emaildisclaimer.htm

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-18 Thread Aaron Kulkis

Josef Assad wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aaron Kulkis wrote:

Bryen wrote:
I did a
find . -name -exec rm \{\}\;


Just curious; what use cases are there for calling find with -name
without a pattern for -name?



ooops.  that should have been
find . -print -exec rm \{\}\;




I *SHOULD have done

find /tmp -name rm \{\} \;


This one too; looks to me like the pattern being passed to -name is rm
itself...


find /tmp -print rm \{\} \;


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-18 Thread Bryen

On Sun, 2007-11-18 at 11:35 -0700, Carlos F Lange wrote:
> On Sun November 18 2007 11:25, Catimimi wrote:
> >  Carlos F Lange a écrit :
> > On Sun November 18 2007 01:01, Catimimi wrote:
> >
> > Aaron Kulkis a écrit :
> >
> > Bryen wrote:
> >
> > Is there any way to undo an rm in terminal?
> >
> > Have a look here :
> >
> > http://www.diskdoctors.net/linux-data-recovery/software.html
> >
> >
> > Is the world backwards?
> > This is a Win32 product!
> > Do they want me to go and find a Windows machine to run this recovery
> > tool for a Linux formated disk? What are they thinking?
> >
> >
> >  It's up to you to decide. I don't want anything except to try to
> > help, your problem is to know if you want to get your data back. Is
> > it a shame to have a solution with a windows product ?
> 
When recovering a file has such important and critical time restraints
it is a shame when the vendor markets a product that may be pointlessly
defeated if it takes time to go to another machine (whatever that
machine is.)  They're not only advocating GOING to another machine, but
do a different operating system for which the original file system is
not a native of.

The shame to me is that it is seemingly preying upon the knowledge gap
of some users who don't realize that timing is everything when it comes
to recovery.

Regardless, I have seen plenty of decent alternatives in the last 24
hours from other posters that can avoid the need for a paid product that
requires the use of a paid operating system in order to recover my files
on my free (or free-er) operating system.

> Michel,
> I am thankful to you for pointing this product out, which I didn't find 
> in my quick search yesterday. I was just venting my frustration. 
> In fact, I went beyond venting and contacted their sales rep online 
> right now and put in a request for a Linux version of the product, not 
> because of shame, but because I don't have any Windows box left in the 
> house...
> 
That would make alot of sense.  I'm down to only one XP from my laptop,
which is actually on original OEM drive pulled out and placed in a safe
location (next to the furnace) and use another drive to run Linux.

And appropriately, the way to get the vendors of the world to start
developing more for Linux is to hear more from us.  
> -- 
> Carlos FL
> 
> Who is General Failure, and why is he reading my disk?
Apparently General Failure is the guy working over at Disk Doctors.
Hah!  I couldn't resist.

-- 
---Bryen---

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-18 Thread Carlos F Lange
On Sun November 18 2007 11:25, Catimimi wrote:
>  Carlos F Lange a écrit :
> On Sun November 18 2007 01:01, Catimimi wrote:
>
> Aaron Kulkis a écrit :
>
> Bryen wrote:
>
> Is there any way to undo an rm in terminal?
>
> Have a look here :
>
> http://www.diskdoctors.net/linux-data-recovery/software.html
>
>
> Is the world backwards?
> This is a Win32 product!
> Do they want me to go and find a Windows machine to run this recovery
> tool for a Linux formated disk? What are they thinking?
>
>
>  It's up to you to decide. I don't want anything except to try to
> help, your problem is to know if you want to get your data back. Is
> it a shame to have a solution with a windows product ?

Michel,
I am thankful to you for pointing this product out, which I didn't find 
in my quick search yesterday. I was just venting my frustration. 
In fact, I went beyond venting and contacted their sales rep online 
right now and put in a request for a Linux version of the product, not 
because of shame, but because I don't have any Windows box left in the 
house...

-- 
Carlos FL

Who is General Failure, and why is he reading my disk?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-18 Thread Carlos F Lange
On Sun November 18 2007 01:01, Catimimi wrote:
> Aaron Kulkis a écrit :
> > Bryen wrote:
> >> Is there any way to undo an rm in terminal?
>
> Have a look here :
>
> http://www.diskdoctors.net/linux-data-recovery/software.html

Is the world backwards?
This is a Win32 product!
Do they want me to go and find a Windows machine to run this recovery 
tool for a Linux formated disk? What are they thinking?

-- 
Carlos FL

Who is General Failure, and why is he reading my disk?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-18 Thread Bryen

On Sun, 2007-11-18 at 13:11 +0200, Josef Assad wrote:

> In any case, when you use libtrash you'll still have to empty the trash
> periodically, and then someone will empty trash containing a file they
> wanted and the thread topic will be "undoing a libtrash delete" rather
> than "Undoing a delete" :)

The phrase "Fool me once, shame on you.  Fool me twice, shame on me." comes to 
mind here.

To have deleted the file once accidentally, well that can happen to anyone. 
But to then delete the file yet again from trash...  well shame on you.  :-)


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-18 Thread Josef Assad
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Stephan Hegel wrote:
> Patrick Shanahan wrote:
>> * Bryen <[EMAIL PROTECTED]> [11-17-07 18:44]:
>> a deterrent, alias rm='/bin/rm -i'
> I remember another approach:
> http://pages.stern.nyu.edu/~marriaga/software/libtrash
> Basically it intercepts syscalls like "unlink", etc. and replaces
> them with its own implementations.
> 
> Somebody out there who's tried this ?

I seem to recall from the days preceding recorded history of my linux
usage that libtrash had some problem with mutt.

In any case, when you use libtrash you'll still have to empty the trash
periodically, and then someone will empty trash containing a file they
wanted and the thread topic will be "undoing a libtrash delete" rather
than "Undoing a delete" :)

It's really aliasing rm which is the most effective solution, coupled
with backups.


JA


- --
http://www.DonAssad.com
jabber ID: [EMAIL PROTECTED]

Please consider the environment; do you really need to print out this
e-mail?
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFHQB32Fcf72sjD2+QRAjrMAJ9PlUUczU76ZJNni849/Bsr7JgJpACfcJ5h
z4IBqTdLxxWmZ+WQSbIM/qE=
=fdnG
-END PGP SIGNATURE-
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-18 Thread Josef Assad
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aaron Kulkis wrote:
> Bryen wrote:
> I did a
> find . -name -exec rm \{\}\;

Just curious; what use cases are there for calling find with -name
without a pattern for -name?

> I *SHOULD have done
> 
> find /tmp -name rm \{\} \;

This one too; looks to me like the pattern being passed to -name is rm
itself...



JA


- --
http://www.DonAssad.com
jabber ID: [EMAIL PROTECTED]

Please consider the environment; do you really need to print out this
e-mail?
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFHQBzbFcf72sjD2+QRAuLkAJ0b4js8KLKw4ZWdifEgXj/1yU8CawCgoBZ6
2W+6b4O3LAuhUjBrg/n444g=
=Ji0w
-END PGP SIGNATURE-
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-18 Thread Catimimi

Aaron Kulkis a écrit :

Bryen wrote:

Is there any way to undo an rm in terminal?



Have a look here :

http://www.diskdoctors.net/linux-data-recovery/software.html

Good luck.
Michel

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Aaron Kulkis

Bryen wrote:

Is there any way to undo an rm in terminal?


No.  Unless you want to spend a lot of money.


 Probably not, but thought I'd ask...


Of course, in the 24 years since I started using Unix,
there have been exactly 2 times when I rm'ed files which
I didn't want to.

The first time was in 1986 or 1987 when I accidentally
rm'ed a C source code file.   Fortunately, i had a hard
copy print out after a recent edit.

The second time was in a find command

I was in /, but I had just done ls /tmp, and for some
reason, I was thinking I was in /tmp,... a guy's /tmp
was filled on his workstation, and he was all over me
to hurry up

I did a
find . -name -exec rm \{\}\;

I *SHOULD have done

find /tmp -name rm \{\} \;

about halfway through /bin, I realized something was
seriously wrong, and hit Ctrl-C

TOO LATE!

I had to reinstall the OS (HP-UX)

That was 1995.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Aaron Kulkis

Bryen wrote:

On Sat, 2007-11-17 at 17:18 -0700, Carlos F Lange wrote:

On Sat November 17 2007 15:40, Bryen wrote:

Is there any way to undo an rm in terminal?  Probably not, but
thought I'd ask...
Googling for "undelete ext3" showed this recent link, which might lead 
you somewhere:

http://kerneltrap.org/node/14493

--
Carlos FL


Cool... I'm going to give this giis tool a try.  Unfortunately, the
disclaimer is that you can't undelete files deleted before giis was
installed.  Aggghh!!!

I'm just going to live with the fact that the only thing deleted was
just my afternoon's work, and not anything mission-critical.



Advice...when writing scripts which REMOVE files, always
set up a test directory structure first.

example:


cp -R realdata test

This will recreate the entire realdata directory tree
(including files) in another directory called test.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Stephan Hegel
Patrick Shanahan wrote:
> * Bryen <[EMAIL PROTECTED]> [11-17-07 18:44]:
>> You'd think, since I googled and see enough people have done this same
>> thing accidentally, that a trashcan folder would be standard.  Oh
>> well...
> 
> there is and it is, but that is a graphical thing and *can* be
> bypassed, but it does not save you from command line rm.
> 
> a deterrent, alias rm='/bin/rm -i'
I remember another approach:
http://pages.stern.nyu.edu/~marriaga/software/libtrash
Basically it intercepts syscalls like "unlink", etc. and replaces
them with its own implementations.

Somebody out there who's tried this ?

Rgds,
   Stephan.
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Cristian Rodríguez
Bryen escribió:
> Is there any way to undo an rm in terminal?  Probably not, but thought
> I'd ask...
> 
> 

In short: no.

http://www.faqs.org/docs/artu/ch20s03.html#id3015838

In large: yes, but you need a good chunk of knowledge, luck, and
sometimes some really very expensive hardware.

They only easy and cheap way is called backups.




-- 
"The only thing that interferes with my learning is my education." -
Albert Einstein
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Bryen

On Sat, 2007-11-17 at 16:32 -0800, Randall R Schulz wrote:

> > Critique me here.  As I'm going by theory.  I would move the
> > current /bin/rm to a new location.
> 
> Whoa! No, no no. Never do that!!
> 
> No, just create a directory ~/bin (equally, $HOME/bin) and put your 
> personal scripts there. Make sure that directory precedes the stock 
> directories in the PATH variable. (I don't recall if $HOME/bin is part 
> of the stock PATH or not, but if it isn't, add a line like this to 
> your "$HOME/.bash_profile" script:
> 
> PATH="$HOME/bin:$PATH"
> 
> > Then I would create an rm script 
> > and place it in /bin where the current rm was located.
> 
> No. Put it in ~/bin ($HOME/bin).
> 
> 
> > But within the rm script, I would point to the rm command's full path
> > when using rm's functionality.
> 
> Well, the point is to avoid what the stock "rm" does and instead move 
> the file to an out-of-the-way place from which you can retrieve it 
> should you change your mind.
> 
> 
> > Thus users would never see the difference when they run /bin/rm, but
> > the script does the interpretation to /somewherelse/rm.
> >
> > Did I figure it out right?
> 
> Uh. Keep trying.
> 
> Perhaps for someone as new to all this as you, playing around with 
> replacements for key OS utilities isn't the best idea.
> 
> You could use Konqueror or ... what's it called? There's a Gnome file 
> manager, too. They're GUIs that have trash cans and "Empty Trash" 
> commands and all that usual stuff.
> 
> 
I'm not that new.  Just new to scripting itself within Linux, but
willing to take my chances and experiment (even break) to further my
knowledge.  As for GUI (Nautilus on GNOME), as Patrick pointed out, when
rm-ing on the command line, it doesn't fall into the GUI trash can.
Only when you delete within GUI.  I double-verified this just to be
sure. 

I didn't realize that you could create ~/bin which would take precedence
over standard /bin.  Now that I know, I can proceed a bit more safely.  

To me, this is an excellent trial/error exercise that coincides
perfectly with my scripting studies.  And I do appreciate the feedback
you've given.  Lots of good foundational information from you.  I thank
you.


-- 
---Bryen---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Randall R Schulz
On Saturday 17 November 2007 16:24, Bryen wrote:
> On Sat, 2007-11-17 at 15:53 -0800, Randall R Schulz wrote:
> > On Saturday 17 November 2007 15:41, Bryen wrote:
> > > On Sat, 2007-11-17 at 15:30 -0800, Randall R Schulz wrote:
> > > > ...
> > > >
> > > > I've known users (dare I say, "lusers") to override rm with a
> > > > script that moves the target files to a trashcan folder.
> > >
> > > Hmm... That would be an interesting project to try to create. 
> > > What a way for me to flex my current knowledge and expand on it. 
> > > :-)
> >
> > It's no big deal. Write an "rm" replacement script that moves files
> > to a specified trash folder rather than simply unlink them. ...
>
> So how would a script called rm not conflict with the real rm McCoy?
> Nothing to you, but I'm just starting to get into scripting.  :-)

It's a matter of precedence. You put the replacement "rm" in a directory 
that is checked before the stock one (/bin).


> Critique me here.  As I'm going by theory.  I would move the
> current /bin/rm to a new location.

Whoa! No, no no. Never do that!!

No, just create a directory ~/bin (equally, $HOME/bin) and put your 
personal scripts there. Make sure that directory precedes the stock 
directories in the PATH variable. (I don't recall if $HOME/bin is part 
of the stock PATH or not, but if it isn't, add a line like this to 
your "$HOME/.bash_profile" script:

PATH="$HOME/bin:$PATH"

> Then I would create an rm script 
> and place it in /bin where the current rm was located.

No. Put it in ~/bin ($HOME/bin).


> But within the rm script, I would point to the rm command's full path
> when using rm's functionality.

Well, the point is to avoid what the stock "rm" does and instead move 
the file to an out-of-the-way place from which you can retrieve it 
should you change your mind.


> Thus users would never see the difference when they run /bin/rm, but
> the script does the interpretation to /somewherelse/rm.
>
> Did I figure it out right?

Uh. Keep trying.

Perhaps for someone as new to all this as you, playing around with 
replacements for key OS utilities isn't the best idea.

You could use Konqueror or ... what's it called? There's a Gnome file 
manager, too. They're GUIs that have trash cans and "Empty Trash" 
commands and all that usual stuff.


> --
> ---Bryen---


Randall Schuzl
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Bryen

On Sat, 2007-11-17 at 17:18 -0700, Carlos F Lange wrote:
> On Sat November 17 2007 15:40, Bryen wrote:
> > Is there any way to undo an rm in terminal?  Probably not, but
> > thought I'd ask...
> 
> Googling for "undelete ext3" showed this recent link, which might lead 
> you somewhere:
> http://kerneltrap.org/node/14493
> 
> -- 
> Carlos FL

Cool... I'm going to give this giis tool a try.  Unfortunately, the
disclaimer is that you can't undelete files deleted before giis was
installed.  Aggghh!!!

I'm just going to live with the fact that the only thing deleted was
just my afternoon's work, and not anything mission-critical.

Thanks everyone!

> 
> ---Bryen---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Bryen

On Sat, 2007-11-17 at 15:53 -0800, Randall R Schulz wrote:
> On Saturday 17 November 2007 15:41, Bryen wrote:
> > On Sat, 2007-11-17 at 15:30 -0800, Randall R Schulz wrote:
> > > ...
> >
> > > I've known users (dare I say, "lusers") to override rm with a
> > > script that moves the target files to a trashcan folder.
> >
> > Hmm... That would be an interesting project to try to create.  What a
> > way for me to flex my current knowledge and expand on it.  :-)
> 
> It's no big deal. Write an "rm" replacement script that moves files to a 
> specified trash folder rather than simply unlink them. The only thing 
> you really have to worry about is name clashes. When that happens, add 
> a suffix (making sure that the suffix is unique, of course). With a bit 
> more work, you could additionally mimic the file system hierarchy 
> within the trash folder, but that doesn't get you out of handling 
> multiple deletes of the same name (since files often get recreated 
> after they're deleted).
> 
So how would a script called rm not conflict with the real rm McCoy?
Nothing to you, but I'm just starting to get into scripting.  :-)  

Critique me here.  As I'm going by theory.  I would move the
current /bin/rm to a new location.  Then I would create an rm script and
place it in /bin where the current rm was located.  But within the rm
script, I would point to the rm command's full path when using rm's
functionality.

Thus users would never see the difference when they run /bin/rm, but the
script does the interpretation to /somewherelse/rm.

Did I figure it out right?  

-- 
---Bryen---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Carlos F Lange
On Sat November 17 2007 15:40, Bryen wrote:
> Is there any way to undo an rm in terminal?  Probably not, but
> thought I'd ask...

Googling for "undelete ext3" showed this recent link, which might lead 
you somewhere:
http://kerneltrap.org/node/14493

-- 
Carlos FL

Who is General Failure, and why is he reading my disk?
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Bryen

On Sat, 2007-11-17 at 18:51 -0500, Patrick Shanahan wrote:
> * Bryen <[EMAIL PROTECTED]> [11-17-07 18:44]:
> > 
> > You'd think, since I googled and see enough people have done this same
> > thing accidentally, that a trashcan folder would be standard.  Oh
> > well...
> 
> there is and it is, but that is a graphical thing and *can* be
> bypassed, but it does not save you from command line rm.
> 
> a deterrent, alias rm='/bin/rm -i'
> 
That's a good idea, and I'm going to do just that.  Although, in this
case, it probably wouldn't have worked perfectly.  I assumed I was in a
different directory and ran  rm *.   I rm'ed when I wanted to, just not
WHERE I wanted to.  :-)

This is what happens when you're holed up on a Saturday afternoon
writing scripts instead of playing outside.  
-- 
---Bryen---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Paul Hands
There is a remote possibility if you haven't rebooted or done anything
dramatic since the delete.

http://www.linux.com/articles/58142

Paul



Bryen wrote:
> On Sat, 2007-11-17 at 15:30 -0800, Randall R Schulz wrote:
>   
>> On Saturday 17 November 2007 14:40, Bryen wrote:
>> 
>>> Is there any way to undo an rm in terminal?  Probably not, but
>>> thought I'd ask...
>>>   
>> The short answer is "no." There's no "trashcan" or "wastebin" involved. 
>> Only with tremendous luck and heroic effort could you hope to recover 
>> the contents of the file to which you applied the stock "rm" command.
>>
>> 
> You'd think, since I googled and see enough people have done this same
> thing accidentally, that a trashcan folder would be standard.  Oh
> well...
>
>   
>> I've known users (dare I say, "lusers") to override rm with a script 
>> that moves the target files to a trashcan folder.
>>
>> 
> Hmm... That would be an interesting project to try to create.  What a
> way for me to flex my current knowledge and expand on it.  :-)
>
>   
>> I don't suppose it will be long now before we have a Linux counterpart 
>> to the latest Mac OS's "Time Machine" functionality.
>>
>>
>> 
> There's a python script that I downloaded a few weeks ago but haven't
> really tried it yet.  It is supposed to mimic TimeMachine.  It's called
> Flyback.  You can find it at http://code.google.com/p/flyback/
>
> Maybe I better look at it again now before I screw anything else
> up!  :-)
>
>
>   

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Randall R Schulz
On Saturday 17 November 2007 15:41, Bryen wrote:
> On Sat, 2007-11-17 at 15:30 -0800, Randall R Schulz wrote:
> > ...
>
> > I've known users (dare I say, "lusers") to override rm with a
> > script that moves the target files to a trashcan folder.
>
> Hmm... That would be an interesting project to try to create.  What a
> way for me to flex my current knowledge and expand on it.  :-)

It's no big deal. Write an "rm" replacement script that moves files to a 
specified trash folder rather than simply unlink them. The only thing 
you really have to worry about is name clashes. When that happens, add 
a suffix (making sure that the suffix is unique, of course). With a bit 
more work, you could additionally mimic the file system hierarchy 
within the trash folder, but that doesn't get you out of handling 
multiple deletes of the same name (since files often get recreated 
after they're deleted).


> > I don't suppose it will be long now before we have a Linux
> > counterpart to the latest Mac OS's "Time Machine" functionality.
>
> There's a python script that I downloaded a few weeks ago but haven't
> really tried it yet.  It is supposed to mimic TimeMachine.  It's
> called Flyback.  You can find it at http://code.google.com/p/flyback/

I doubt tremendously (i.e., I flatly don't believe) that Python can be 
used to implement Time Machine. Doing that will require some low-level 
hooks.


> Maybe I better look at it again now before I screw anything else
> up!  :-)

It could be both useful and educational, so yes, go for it.


> --
> ---Bryen---


Randall Schulz
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Randall R Schulz
On Saturday 17 November 2007 14:40, Bryen wrote:
> Is there any way to undo an rm in terminal?  Probably not, but
> thought I'd ask...

The short answer is "no." There's no "trashcan" or "wastebin" involved. 
Only with tremendous luck and heroic effort could you hope to recover 
the contents of the file to which you applied the stock "rm" command.

I've known users (dare I say, "lusers") to override rm with a script 
that moves the target files to a trashcan folder.


I don't suppose it will be long now before we have a Linux counterpart 
to the latest Mac OS's "Time Machine" functionality.


> --
> ---Bryen---


Randall Schulz

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Patrick Shanahan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* Bryen <[EMAIL PROTECTED]> [11-17-07 18:44]:
> 
> You'd think, since I googled and see enough people have done this same
> thing accidentally, that a trashcan folder would be standard.  Oh
> well...

there is and it is, but that is a graphical thing and *can* be
bypassed, but it does not save you from command line rm.

a deterrent, alias rm='/bin/rm -i'


- -- 
Patrick Shanahan Plainfield, Indiana, USAHOG # US1244711
http://wahoo.no-ip.org Photo Album:  http://wahoo.no-ip.org/gallery2
Registered Linux User #207535@ http://counter.li.org
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFHP36XClSjbQz1U5oRAtIqAJ4ltXIbvMBre2Mr+5TkCim4dtzXlwCfU5Zn
d7k517NVdxm1OQo0k6h8G0Q=
=9dUM
-END PGP SIGNATURE-
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Bryen

On Sat, 2007-11-17 at 15:30 -0800, Randall R Schulz wrote:
> On Saturday 17 November 2007 14:40, Bryen wrote:
> > Is there any way to undo an rm in terminal?  Probably not, but
> > thought I'd ask...
> 
> The short answer is "no." There's no "trashcan" or "wastebin" involved. 
> Only with tremendous luck and heroic effort could you hope to recover 
> the contents of the file to which you applied the stock "rm" command.
> 
You'd think, since I googled and see enough people have done this same
thing accidentally, that a trashcan folder would be standard.  Oh
well...

> I've known users (dare I say, "lusers") to override rm with a script 
> that moves the target files to a trashcan folder.
> 
Hmm... That would be an interesting project to try to create.  What a
way for me to flex my current knowledge and expand on it.  :-)

> 
> I don't suppose it will be long now before we have a Linux counterpart 
> to the latest Mac OS's "Time Machine" functionality.
> 
> 
There's a python script that I downloaded a few weeks ago but haven't
really tried it yet.  It is supposed to mimic TimeMachine.  It's called
Flyback.  You can find it at http://code.google.com/p/flyback/

Maybe I better look at it again now before I screw anything else
up!  :-)


-- 
---Bryen---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Bryen

On Sat, 2007-11-17 at 23:59 +0100, Theo v. Werkhoven wrote:
> Sat, 17 Nov 2007, by [EMAIL PROTECTED]:
> 
> > Is there any way to undo an rm in terminal?  Probably not, but thought
> > I'd ask...
> 
> A backup comes to mind..
> What filesystem, did you google?
> http://e2undel.sourceforge.net/recovery-howto.html

A backup doesn't apply in this case.  :-(  It was a script I was working
on this afternoon.  Brand new, hasn't gone into the backup cycle yet.
And my fs is ext3.


-- 
---Bryen---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Undoing a delete

2007-11-17 Thread Theo v. Werkhoven
Sat, 17 Nov 2007, by [EMAIL PROTECTED]:

> Is there any way to undo an rm in terminal?  Probably not, but thought
> I'd ask...

A backup comes to mind..
What filesystem, did you google?
http://e2undel.sourceforge.net/recovery-howto.html

Theo
-- 
Theo v. WerkhovenRegistered Linux user# 99872 http://counter.li.org
ICBM 52 13 26N , 4 29 47E. +  ICQ: 277217131
SUSE 10.2  +   Jabber: [EMAIL PROTECTED]
Kernel 2.6.20  +   See headers for PGP/GPG info.
Claimer: any email I receive will become my property. Disclaimers do not apply.
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[opensuse] Undoing a delete

2007-11-17 Thread Bryen
Is there any way to undo an rm in terminal?  Probably not, but thought
I'd ask...


-- 
---Bryen---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]