Re: [R] [Rd] R CMD build wiped my computer

2010-07-28 Thread Ray Brownrigg
On Thu, 29 Jul 2010, Duncan Murdoch wrote:
> On 28/07/2010 10:01 AM, Jarrod Hadfield wrote:
> > Hi Marc,
> >
> > Thanks for the info on recovery - most of it can pieced together from
> > backups but a quick, cheap and easy method of recovery would have been
> > nicer.
> >
> > My main concern is that this could happen again and that the "bug" is
> > not limited to R 2.9. I would think that an accidental carriage return
> > at the end of a file name (even a temporary one) would be a reasonably
> > common phenomenon (I'm surprised I hadn't done it before).
>
> If you can put together a recipe to reproduce the problem (or a less
> extreme version of R deleting files it shouldn't), we'll certainly fix
> it.  But so far all we've got are guesses about what might have gone
> wrong, and I don't think anyone has been able to reproduce the problem
> on current R.
>
Duncan:

It looks to me like it has already been fixed, if indeed that was the problem.  
In 
R-2.10.1, I tried to reproduce the problem (using RColorBrewer, since that was 
the 
smallest package I have a local copy of), and the build produced this:
:
* removing junk files
* excluding invalid files from 'RColorBrewer'
Subdirectory 'R' contains invalid file names:
  residuals.MCMCglmm.R xyz
:
where the space shown between the "R" and the "xyz" was a newline character. [I 
didn't 
dare try using a "~" :-)]

Ray Brownrigg

> Duncan Murdoch
>
> > Cheers,
> >
> > Jarrod
> >
> > On 28 Jul 2010, at 14:04, Marc Schwartz wrote:
> > > Jarrod,
> > >
> > > Noting your exchange with Martin, Martin brings up a point that
> > > certainly I missed, which is that somehow the tilde ('~') character
> > > got into the chain of events. As Martin noted, on Linuxen/Unixen
> > > (including OSX), the tilde, when used in the context of file name
> > > globbing, refers to your home directory. Thus, a command such as:
> > >
> > >  ls ~
> > >
> > > will list the files in your home directory. Similarly:
> > >
> > >  rm ~
> > >
> > > will remove the files there as well. If the -rf argument is added,
> > > then the deletion becomes recursive through that directory tree,
> > > which appears to be the case here.
> > >
> > > I am unclear, as Martin appears to be, as to the steps that caused
> > > this to happen. That may yet be related in some fashion to Duncan's
> > > hypothesis.
> > >
> > > That being said, the use of the tilde character as a suffix to
> > > denote that a file is a backup version, is not limited to Fedora or
> > > Linux, for that matter. It is quite common for many text editors
> > > (eg. Emacs) to use this. As a result, it is also common for many
> > > applications to ignore files that have a tilde suffix.
> > >
> > > Based upon your follow up posts to the original thread, it would
> > > seem that you do not have any backups. The default ext3 file system
> > > that is used on modern Linuxen, by design, makes it a bit more
> > > difficult to recover deleted files. This is due to the unlinking of
> > > file metadata at the file system data structure level, as opposed to
> > > simply marking the file as deleted in the directory structures, as
> > > happens on Windows.
> > >
> > > There is a utility called ext3undel
> > > (http://projects.izzysoft.de/trac/ext3undel ), which is a wrapper of
> > > sorts to other undelete utilities such as PhotoRec and foremost. I have
> > > not used it/them, so cannot speak from personal experience. Thus it
> > > would be a good idea to engage in some reviews of the documentation and
> > > perhaps other online resources before proceeding. The other
> > > consideration is the Catch-22 of not copying anything new to your
> > > existing HD, for fear of overwriting the lost files with new data. So
> > > you would need to consider an approach of downloading these utilities
> > > via another computer and then running them on the computer in question
> > > from other media, such as a CD/DVD or USB HD.
> > >
> > > A more expensive option would be to use a professional data recovery
> > > service, where you would have to consider the cost of recovery
> > > versus your lost time. One option would be Kroll OnTrack UK
> > > (http://www.ontrackdatarecovery.co.uk/ ). I happen to live about a
> > > quarter mile from their world HQ here in a suburb of Minneapolis. I
> > > have not used them myself, but others that I know have, with good
> > > success. Again, this comes at a
> > > potentially substantial monetary cost.
> > >
> > > The key is that if you have any hope to recover the deleted files,
> > > you not copy anything new onto the hard drive in the mean time.
> > > Doing so will decrease the possibility of file recovery to near 0.
> > >
> > > As Duncan noted, there is great empathy with your situation. We have
> > > all gone through this at one time or another. In my case, it was
> > > perhaps 20+ years ago, but as a result, I am quite anal retentive
> > > about having backups, which I have done for some time on my systems,
> > > hourly.
> > >
> > > HTH

Re: [R] [Rd] R CMD build wiped my computer

2010-07-28 Thread Kevin Wright
Isn't the trash a feature of the Gnome GUI, not the shell?

Using "rm" has always scared me, so I've recently configured my system thus:

Install trash-cli.  See http://code.google.com/p/trash-cli/
Alias "del" to trash-put.
<http://code.google.com/p/trash-cli/>Set a cron job to clean trash after xxx
days.

You probably could alias rm to trash-put, but trash-put doesn't support all
the flags of rm and this would be uncharted waters...

Kevin


On Wed, Jul 28, 2010 at 3:18 PM, Bos, Roger wrote:

> Ubuntu also uses ~ as a backup file syntax, but Ubuntu has a trash can
> where deleted files are located, so it would be easy to restore them.  I
> would be surprised if Fedora didn't also have a trash can.
>
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of Duncan Murdoch
> Sent: Wednesday, July 28, 2010 11:12 AM
> To: Jarrod Hadfield
> Cc: r-help@r-project.org; Marc Schwartz
> Subject: Re: [R] [Rd] R CMD build wiped my computer
>
> On 28/07/2010 10:01 AM, Jarrod Hadfield wrote:
> > Hi Marc,
> >
> > Thanks for the info on recovery - most of it can pieced together from
> > backups but a quick, cheap and easy method of recovery would have been
>
> > nicer.
> >
> > My main concern is that this could happen again and that the "bug" is
> > not limited to R 2.9. I would think that an accidental carriage return
>
> > at the end of a file name (even a temporary one) would be a reasonably
>
> > common phenomenon (I'm surprised I hadn't done it before).
> >
>
> If you can put together a recipe to reproduce the problem (or a less
> extreme version of R deleting files it shouldn't), we'll certainly fix
> it.  But so far all we've got are guesses about what might have gone
> wrong, and I don't think anyone has been able to reproduce the problem
> on current R.
>
> Duncan Murdoch
> > Cheers,
> >
> > Jarrod
> >
> >
> >
> > On 28 Jul 2010, at 14:04, Marc Schwartz wrote:
> >
> > > Jarrod,
> > >
> > > Noting your exchange with Martin, Martin brings up a point that
> > > certainly I missed, which is that somehow the tilde ('~') character
> > > got into the chain of events. As Martin noted, on Linuxen/Unixen
> > > (including OSX), the tilde, when used in the context of file name
> > > globbing, refers to your home directory. Thus, a command such as:
> > >
> > >  ls ~
> > >
> > > will list the files in your home directory. Similarly:
> > >
> > >  rm ~
> > >
> > > will remove the files there as well. If the -rf argument is added,
> > > then the deletion becomes recursive through that directory tree,
> > > which appears to be the case here.
> > >
> > > I am unclear, as Martin appears to be, as to the steps that caused
> > > this to happen. That may yet be related in some fashion to Duncan's
> > > hypothesis.
> > >
> > > That being said, the use of the tilde character as a suffix to
> > > denote that a file is a backup version, is not limited to Fedora or
> > > Linux, for that matter. It is quite common for many text editors
> > > (eg. Emacs) to use this. As a result, it is also common for many
> > > applications to ignore files that have a tilde suffix.
> > >
> > > Based upon your follow up posts to the original thread, it would
> > > seem that you do not have any backups. The default ext3 file system
> > > that is used on modern Linuxen, by design, makes it a bit more
> > > difficult to recover deleted files. This is due to the unlinking of
> > > file metadata at the file system data structure level, as opposed to
>
> > > simply marking the file as deleted in the directory structures, as
> > > happens on Windows.
> > >
> > > There is a utility called ext3undel
> > > (http://projects.izzysoft.de/trac/ext3undel
> > > ), which is a wrapper of sorts to other undelete utilities such as
> > > PhotoRec and foremost. I have not used it/them, so cannot speak from
>
> > > personal experience. Thus it would be a good idea to engage in some
> > > reviews of the documentation and perhaps other online resources
> > > before proceeding. The other consideration is the Catch-22 of not
> > > copying anything new to your existing HD, for fear of overwriting
> > > the lost files with new data. So you would need to consider an
> > > approach of downloading these utilities via another compu

Re: [R] [Rd] R CMD build wiped my computer

2010-07-28 Thread Marc Schwartz
On Jul 28, 2010, at 3:18 PM, Bos, Roger wrote:

> Ubuntu also uses ~ as a backup file syntax, but Ubuntu has a trash can
> where deleted files are located, so it would be easy to restore them.  I
> would be surprised if Fedora didn't also have a trash can. 



Roger,

It does, but that is only if you use GUI based file deletion functionality with 
applications (eg. file managers) that support the trash can folder for the 
desktop environment that you are using (eg. GNOME, KDE, XFCE, etc.). In that 
case, the files are moved to the trash can folder, rather than deleting them 
from the source location.

In recent years, on Linux, that has been standardized using the freedesktop.org 
standards, so that most popular GUI based applications use the same locations 
for common functionality. Before that, differing environments had the trash can 
folder in different locations, such as ~/.Trash or elsewhere within the user's 
folder tree. So, if you happened to use more then one desktop environment, or 
say used a KDE application (eg. Konqueror) from within GNOME, you could have 
more than one trash can on your system.

If you remove files via the CLI (eg. a shell script), they don't go into the 
trash can folder. They are just deleted.

Regards,

Marc

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] [Rd] R CMD build wiped my computer

2010-07-28 Thread Bos, Roger
Ubuntu also uses ~ as a backup file syntax, but Ubuntu has a trash can
where deleted files are located, so it would be easy to restore them.  I
would be surprised if Fedora didn't also have a trash can. 

-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Duncan Murdoch
Sent: Wednesday, July 28, 2010 11:12 AM
To: Jarrod Hadfield
Cc: r-help@r-project.org; Marc Schwartz
Subject: Re: [R] [Rd] R CMD build wiped my computer

On 28/07/2010 10:01 AM, Jarrod Hadfield wrote:
> Hi Marc,
>
> Thanks for the info on recovery - most of it can pieced together from 
> backups but a quick, cheap and easy method of recovery would have been

> nicer.
>
> My main concern is that this could happen again and that the "bug" is 
> not limited to R 2.9. I would think that an accidental carriage return

> at the end of a file name (even a temporary one) would be a reasonably

> common phenomenon (I'm surprised I hadn't done it before).
>   

If you can put together a recipe to reproduce the problem (or a less
extreme version of R deleting files it shouldn't), we'll certainly fix
it.  But so far all we've got are guesses about what might have gone
wrong, and I don't think anyone has been able to reproduce the problem
on current R.

Duncan Murdoch
> Cheers,
>
> Jarrod
>
>
>
> On 28 Jul 2010, at 14:04, Marc Schwartz wrote:
>
> > Jarrod,
> >
> > Noting your exchange with Martin, Martin brings up a point that 
> > certainly I missed, which is that somehow the tilde ('~') character 
> > got into the chain of events. As Martin noted, on Linuxen/Unixen 
> > (including OSX), the tilde, when used in the context of file name 
> > globbing, refers to your home directory. Thus, a command such as:
> >
> >  ls ~
> >
> > will list the files in your home directory. Similarly:
> >
> >  rm ~
> >
> > will remove the files there as well. If the -rf argument is added, 
> > then the deletion becomes recursive through that directory tree, 
> > which appears to be the case here.
> >
> > I am unclear, as Martin appears to be, as to the steps that caused 
> > this to happen. That may yet be related in some fashion to Duncan's 
> > hypothesis.
> >
> > That being said, the use of the tilde character as a suffix to 
> > denote that a file is a backup version, is not limited to Fedora or 
> > Linux, for that matter. It is quite common for many text editors 
> > (eg. Emacs) to use this. As a result, it is also common for many 
> > applications to ignore files that have a tilde suffix.
> >
> > Based upon your follow up posts to the original thread, it would 
> > seem that you do not have any backups. The default ext3 file system 
> > that is used on modern Linuxen, by design, makes it a bit more 
> > difficult to recover deleted files. This is due to the unlinking of 
> > file metadata at the file system data structure level, as opposed to

> > simply marking the file as deleted in the directory structures, as 
> > happens on Windows.
> >
> > There is a utility called ext3undel 
> > (http://projects.izzysoft.de/trac/ext3undel
> > ), which is a wrapper of sorts to other undelete utilities such as 
> > PhotoRec and foremost. I have not used it/them, so cannot speak from

> > personal experience. Thus it would be a good idea to engage in some 
> > reviews of the documentation and perhaps other online resources 
> > before proceeding. The other consideration is the Catch-22 of not 
> > copying anything new to your existing HD, for fear of overwriting 
> > the lost files with new data. So you would need to consider an 
> > approach of downloading these utilities via another computer and 
> > then running them on the computer in question from other media, such

> > as a CD/DVD or USB HD.
> >
> > A more expensive option would be to use a professional data recovery

> > service, where you would have to consider the cost of recovery 
> > versus your lost time. One option would be Kroll OnTrack UK 
> > (http://www.ontrackdatarecovery.co.uk/
> > ). I happen to live about a quarter mile from their world HQ here in

> > a suburb of Minneapolis. I have not used them myself, but others 
> > that I know have, with good success. Again, this comes at a 
> > potentially substantial monetary cost.
> >
> > The key is that if you have any hope to recover the deleted files, 
> > you not copy anything new onto the hard drive in the mean time.
> > Doing so will decrease the possibility of file recovery to near 0.
> >
> > As Duncan noted, th

Re: [R] [Rd] R CMD build wiped my computer

2010-07-28 Thread Duncan Murdoch

On 28/07/2010 10:01 AM, Jarrod Hadfield wrote:

Hi Marc,

Thanks for the info on recovery - most of it can pieced together from  
backups but a quick, cheap and easy method of recovery would have been  
nicer.


My main concern is that this could happen again and that the "bug" is  
not limited to R 2.9. I would think that an accidental carriage return  
at the end of a file name (even a temporary one) would be a reasonably  
common phenomenon (I'm surprised I hadn't done it before).
  


If you can put together a recipe to reproduce the problem (or a less 
extreme version of R deleting files it shouldn't), we'll certainly fix 
it.  But so far all we've got are guesses about what might have gone 
wrong, and I don't think anyone has been able to reproduce the problem 
on current R.


Duncan Murdoch

Cheers,

Jarrod



On 28 Jul 2010, at 14:04, Marc Schwartz wrote:

> Jarrod,
>
> Noting your exchange with Martin, Martin brings up a point that  
> certainly I missed, which is that somehow the tilde ('~') character  
> got into the chain of events. As Martin noted, on Linuxen/Unixen  
> (including OSX), the tilde, when used in the context of file name  
> globbing, refers to your home directory. Thus, a command such as:

>
>  ls ~
>
> will list the files in your home directory. Similarly:
>
>  rm ~
>
> will remove the files there as well. If the -rf argument is added,  
> then the deletion becomes recursive through that directory tree,  
> which appears to be the case here.

>
> I am unclear, as Martin appears to be, as to the steps that caused  
> this to happen. That may yet be related in some fashion to Duncan's  
> hypothesis.

>
> That being said, the use of the tilde character as a suffix to  
> denote that a file is a backup version, is not limited to Fedora or  
> Linux, for that matter. It is quite common for many text editors  
> (eg. Emacs) to use this. As a result, it is also common for many  
> applications to ignore files that have a tilde suffix.

>
> Based upon your follow up posts to the original thread, it would  
> seem that you do not have any backups. The default ext3 file system  
> that is used on modern Linuxen, by design, makes it a bit more  
> difficult to recover deleted files. This is due to the unlinking of  
> file metadata at the file system data structure level, as opposed to  
> simply marking the file as deleted in the directory structures, as  
> happens on Windows.

>
> There is a utility called ext3undel (http://projects.izzysoft.de/trac/ext3undel 
> ), which is a wrapper of sorts to other undelete utilities such as  
> PhotoRec and foremost. I have not used it/them, so cannot speak from  
> personal experience. Thus it would be a good idea to engage in some  
> reviews of the documentation and perhaps other online resources  
> before proceeding. The other consideration is the Catch-22 of not  
> copying anything new to your existing HD, for fear of overwriting  
> the lost files with new data. So you would need to consider an  
> approach of downloading these utilities via another computer and  
> then running them on the computer in question from other media, such  
> as a CD/DVD or USB HD.

>
> A more expensive option would be to use a professional data recovery  
> service, where you would have to consider the cost of recovery  
> versus your lost time. One option would be Kroll OnTrack UK (http://www.ontrackdatarecovery.co.uk/ 
> ). I happen to live about a quarter mile from their world HQ here in  
> a suburb of Minneapolis. I have not used them myself, but others  
> that I know have, with good success. Again, this comes at a  
> potentially substantial monetary cost.

>
> The key is that if you have any hope to recover the deleted files,  
> you not copy anything new onto the hard drive in the mean time.  
> Doing so will decrease the possibility of file recovery to near 0.

>
> As Duncan noted, there is great empathy with your situation. We have  
> all gone through this at one time or another. In my case, it was  
> perhaps 20+ years ago, but as a result, I am quite anal retentive  
> about having backups, which I have done for some time on my systems,  
> hourly.

>
> HTH,
>
> Marc Schwartz
>
>
> On Jul 28, 2010, at 5:55 AM, Jarrod Hadfield wrote:
>
>> Hi Martin,
>>
>> I think this is the most likely reason given that the name in the  
>> DESCRIPTION file does NOT have a version number. Even so, it is  
>> very easy to misname a file and then delete it/change its name (as  
>> I've done here) and I hope current versions of R would not cause  
>> this problem. Perhaps Fedora should not use ~ as its back up file  
>> suffixes?

>>
>> Cheers,
>>
>> Jarrod
>>
>>
>> On 28 Jul 2010, at 11:41, Martin Maechler wrote:
>>
 Jarrod Hadfield 
  on Tue, 27 Jul 2010 21:37:09 +0100 writes:
>>>
 Hi, I ran R (version 2.9.0) CMD build under root in
 Fedora (9). When it tried to remove "junk files" it
 removed EVERYTHING in my local account! (See below

Re: [R] [Rd] R CMD build wiped my computer

2010-07-28 Thread Jarrod Hadfield

Hi Marc,

Thanks for the info on recovery - most of it can pieced together from  
backups but a quick, cheap and easy method of recovery would have been  
nicer.


My main concern is that this could happen again and that the "bug" is  
not limited to R 2.9. I would think that an accidental carriage return  
at the end of a file name (even a temporary one) would be a reasonably  
common phenomenon (I'm surprised I hadn't done it before).


Cheers,

Jarrod



On 28 Jul 2010, at 14:04, Marc Schwartz wrote:


Jarrod,

Noting your exchange with Martin, Martin brings up a point that  
certainly I missed, which is that somehow the tilde ('~') character  
got into the chain of events. As Martin noted, on Linuxen/Unixen  
(including OSX), the tilde, when used in the context of file name  
globbing, refers to your home directory. Thus, a command such as:


 ls ~

will list the files in your home directory. Similarly:

 rm ~

will remove the files there as well. If the -rf argument is added,  
then the deletion becomes recursive through that directory tree,  
which appears to be the case here.


I am unclear, as Martin appears to be, as to the steps that caused  
this to happen. That may yet be related in some fashion to Duncan's  
hypothesis.


That being said, the use of the tilde character as a suffix to  
denote that a file is a backup version, is not limited to Fedora or  
Linux, for that matter. It is quite common for many text editors  
(eg. Emacs) to use this. As a result, it is also common for many  
applications to ignore files that have a tilde suffix.


Based upon your follow up posts to the original thread, it would  
seem that you do not have any backups. The default ext3 file system  
that is used on modern Linuxen, by design, makes it a bit more  
difficult to recover deleted files. This is due to the unlinking of  
file metadata at the file system data structure level, as opposed to  
simply marking the file as deleted in the directory structures, as  
happens on Windows.


There is a utility called ext3undel (http://projects.izzysoft.de/trac/ext3undel 
), which is a wrapper of sorts to other undelete utilities such as  
PhotoRec and foremost. I have not used it/them, so cannot speak from  
personal experience. Thus it would be a good idea to engage in some  
reviews of the documentation and perhaps other online resources  
before proceeding. The other consideration is the Catch-22 of not  
copying anything new to your existing HD, for fear of overwriting  
the lost files with new data. So you would need to consider an  
approach of downloading these utilities via another computer and  
then running them on the computer in question from other media, such  
as a CD/DVD or USB HD.


A more expensive option would be to use a professional data recovery  
service, where you would have to consider the cost of recovery  
versus your lost time. One option would be Kroll OnTrack UK (http://www.ontrackdatarecovery.co.uk/ 
). I happen to live about a quarter mile from their world HQ here in  
a suburb of Minneapolis. I have not used them myself, but others  
that I know have, with good success. Again, this comes at a  
potentially substantial monetary cost.


The key is that if you have any hope to recover the deleted files,  
you not copy anything new onto the hard drive in the mean time.  
Doing so will decrease the possibility of file recovery to near 0.


As Duncan noted, there is great empathy with your situation. We have  
all gone through this at one time or another. In my case, it was  
perhaps 20+ years ago, but as a result, I am quite anal retentive  
about having backups, which I have done for some time on my systems,  
hourly.


HTH,

Marc Schwartz


On Jul 28, 2010, at 5:55 AM, Jarrod Hadfield wrote:


Hi Martin,

I think this is the most likely reason given that the name in the  
DESCRIPTION file does NOT have a version number. Even so, it is  
very easy to misname a file and then delete it/change its name (as  
I've done here) and I hope current versions of R would not cause  
this problem. Perhaps Fedora should not use ~ as its back up file  
suffixes?


Cheers,

Jarrod


On 28 Jul 2010, at 11:41, Martin Maechler wrote:


Jarrod Hadfield 
 on Tue, 27 Jul 2010 21:37:09 +0100 writes:



Hi, I ran R (version 2.9.0) CMD build under root in
Fedora (9). When it tried to remove "junk files" it
removed EVERYTHING in my local account! (See below).



Can anyone tell me what happened,


the culprit may lay here:

* removing junk files
unlink MCMCglmm_2.05/R/   residuals.MCMCglmm.R
~


where it seems that someone (you?) have added a newline
in the filname, so instead of
'residuals.MCMCglmm.R~'
you got

'residuals.MCMCglmm.R
~'

and the unlink / rm  command interpreted '~' as your home
directory.

But I can hardly believe it.
This seems explanation seems a bit doubtful to me.. ...


and even more importantly if I can I restore what was lost.


well, you just get it from the backup. You do daily backups, do

Re: [R] [Rd] R CMD build wiped my computer

2010-07-28 Thread Kevin Wright
I doubt if it will be helpful for Jarrod, but when I hear stories like this,
I remember reading about a similar event and a remarkable partial recovery
here:
http://www.justpasha.org/folk/rm.html

Kevin


On Wed, Jul 28, 2010 at 8:04 AM, Marc Schwartz  wrote:

> Jarrod,
>
> Noting your exchange with Martin, Martin brings up a point that certainly I
> missed, which is that somehow the tilde ('~') character got into the chain
> of events. As Martin noted, on Linuxen/Unixen (including OSX), the tilde,
> when used in the context of file name globbing, refers to your home
> directory. Thus, a command such as:
>
>  ls ~
>
> will list the files in your home directory. Similarly:
>
>  rm ~
>
> will remove the files there as well. If the -rf argument is added, then the
> deletion becomes recursive through that directory tree, which appears to be
> the case here.
>
> I am unclear, as Martin appears to be, as to the steps that caused this to
> happen. That may yet be related in some fashion to Duncan's hypothesis.
>
> That being said, the use of the tilde character as a suffix to denote that
> a file is a backup version, is not limited to Fedora or Linux, for that
> matter. It is quite common for many text editors (eg. Emacs) to use this. As
> a result, it is also common for many applications to ignore files that have
> a tilde suffix.
>
> Based upon your follow up posts to the original thread, it would seem that
> you do not have any backups. The default ext3 file system that is used on
> modern Linuxen, by design, makes it a bit more difficult to recover deleted
> files. This is due to the unlinking of file metadata at the file system data
> structure level, as opposed to simply marking the file as deleted in the
> directory structures, as happens on Windows.
>
> There is a utility called ext3undel (
> http://projects.izzysoft.de/trac/ext3undel), which is a wrapper of sorts
> to other undelete utilities such as PhotoRec and foremost. I have not used
> it/them, so cannot speak from personal experience. Thus it would be a good
> idea to engage in some reviews of the documentation and perhaps other online
> resources before proceeding. The other consideration is the Catch-22 of not
> copying anything new to your existing HD, for fear of overwriting the lost
> files with new data. So you would need to consider an approach of
> downloading these utilities via another computer and then running them on
> the computer in question from other media, such as a CD/DVD or USB HD.
>
> A more expensive option would be to use a professional data recovery
> service, where you would have to consider the cost of recovery versus your
> lost time. One option would be Kroll OnTrack UK (
> http://www.ontrackdatarecovery.co.uk/). I happen to live about a quarter
> mile from their world HQ here in a suburb of Minneapolis. I have not used
> them myself, but others that I know have, with good success. Again, this
> comes at a potentially substantial monetary cost.
>
> The key is that if you have any hope to recover the deleted files, you not
> copy anything new onto the hard drive in the mean time. Doing so will
> decrease the possibility of file recovery to near 0.
>
> As Duncan noted, there is great empathy with your situation. We have all
> gone through this at one time or another. In my case, it was perhaps 20+
> years ago, but as a result, I am quite anal retentive about having backups,
> which I have done for some time on my systems, hourly.
>
> HTH,
>
> Marc Schwartz
>
>
> On Jul 28, 2010, at 5:55 AM, Jarrod Hadfield wrote:
>
> > Hi Martin,
> >
> > I think this is the most likely reason given that the name in the
> DESCRIPTION file does NOT have a version number. Even so, it is very easy to
> misname a file and then delete it/change its name (as I've done here) and I
> hope current versions of R would not cause this problem. Perhaps Fedora
> should not use ~ as its back up file suffixes?
> >
> > Cheers,
> >
> > Jarrod
> >
> >
> > On 28 Jul 2010, at 11:41, Martin Maechler wrote:
> >
> >>> Jarrod Hadfield 
> >>>   on Tue, 27 Jul 2010 21:37:09 +0100 writes:
> >>
> >>> Hi, I ran R (version 2.9.0) CMD build under root in
> >>> Fedora (9). When it tried to remove "junk files" it
> >>> removed EVERYTHING in my local account! (See below).
> >>
> >>> Can anyone tell me what happened,
> >>
> >> the culprit may lay here:
>  * removing junk files
>  unlink MCMCglmm_2.05/R/   residuals.MCMCglmm.R
>  ~
> >>
> >> where it seems that someone (you?) have added a newline
> >> in the filname, so instead of
> >> 'residuals.MCMCglmm.R~'
> >> you got
> >>
> >> 'residuals.MCMCglmm.R
> >> ~'
> >>
> >> and the unlink / rm  command interpreted '~' as your home
> >> directory.
> >>
> >> But I can hardly believe it.
> >> This seems explanation seems a bit doubtful to me.. ...
> >>
> >>> and even more importantly if I can I restore what was lost.
> >>
> >> well, you just get it from the backup. You do dai

Re: [R] [Rd] R CMD build wiped my computer

2010-07-28 Thread Marc Schwartz
Jarrod,

Noting your exchange with Martin, Martin brings up a point that certainly I 
missed, which is that somehow the tilde ('~') character got into the chain of 
events. As Martin noted, on Linuxen/Unixen (including OSX), the tilde, when 
used in the context of file name globbing, refers to your home directory. Thus, 
a command such as:

  ls ~

will list the files in your home directory. Similarly:

  rm ~

will remove the files there as well. If the -rf argument is added, then the 
deletion becomes recursive through that directory tree, which appears to be the 
case here.

I am unclear, as Martin appears to be, as to the steps that caused this to 
happen. That may yet be related in some fashion to Duncan's hypothesis. 

That being said, the use of the tilde character as a suffix to denote that a 
file is a backup version, is not limited to Fedora or Linux, for that matter. 
It is quite common for many text editors (eg. Emacs) to use this. As a result, 
it is also common for many applications to ignore files that have a tilde 
suffix. 

Based upon your follow up posts to the original thread, it would seem that you 
do not have any backups. The default ext3 file system that is used on modern 
Linuxen, by design, makes it a bit more difficult to recover deleted files. 
This is due to the unlinking of file metadata at the file system data structure 
level, as opposed to simply marking the file as deleted in the directory 
structures, as happens on Windows.

There is a utility called ext3undel 
(http://projects.izzysoft.de/trac/ext3undel), which is a wrapper of sorts to 
other undelete utilities such as PhotoRec and foremost. I have not used 
it/them, so cannot speak from personal experience. Thus it would be a good idea 
to engage in some reviews of the documentation and perhaps other online 
resources before proceeding. The other consideration is the Catch-22 of not 
copying anything new to your existing HD, for fear of overwriting the lost 
files with new data. So you would need to consider an approach of downloading 
these utilities via another computer and then running them on the computer in 
question from other media, such as a CD/DVD or USB HD. 

A more expensive option would be to use a professional data recovery service, 
where you would have to consider the cost of recovery versus your lost time. 
One option would be Kroll OnTrack UK (http://www.ontrackdatarecovery.co.uk/). I 
happen to live about a quarter mile from their world HQ here in a suburb of 
Minneapolis. I have not used them myself, but others that I know have, with 
good success. Again, this comes at a potentially substantial monetary cost.

The key is that if you have any hope to recover the deleted files, you not copy 
anything new onto the hard drive in the mean time. Doing so will decrease the 
possibility of file recovery to near 0.

As Duncan noted, there is great empathy with your situation. We have all gone 
through this at one time or another. In my case, it was perhaps 20+ years ago, 
but as a result, I am quite anal retentive about having backups, which I have 
done for some time on my systems, hourly.

HTH,

Marc Schwartz


On Jul 28, 2010, at 5:55 AM, Jarrod Hadfield wrote:

> Hi Martin,
> 
> I think this is the most likely reason given that the name in the DESCRIPTION 
> file does NOT have a version number. Even so, it is very easy to misname a 
> file and then delete it/change its name (as I've done here) and I hope 
> current versions of R would not cause this problem. Perhaps Fedora should not 
> use ~ as its back up file suffixes?
> 
> Cheers,
> 
> Jarrod
> 
> 
> On 28 Jul 2010, at 11:41, Martin Maechler wrote:
> 
>>> Jarrod Hadfield 
>>>   on Tue, 27 Jul 2010 21:37:09 +0100 writes:
>> 
>>> Hi, I ran R (version 2.9.0) CMD build under root in
>>> Fedora (9). When it tried to remove "junk files" it
>>> removed EVERYTHING in my local account! (See below).
>> 
>>> Can anyone tell me what happened,
>> 
>> the culprit may lay here:
 * removing junk files
 unlink MCMCglmm_2.05/R/   residuals.MCMCglmm.R
 ~
>> 
>> where it seems that someone (you?) have added a newline
>> in the filname, so instead of
>> 'residuals.MCMCglmm.R~'
>> you got
>> 
>> 'residuals.MCMCglmm.R
>> ~'
>> 
>> and the unlink / rm  command interpreted '~' as your home
>> directory.
>> 
>> But I can hardly believe it.
>> This seems explanation seems a bit doubtful to me.. ...
>> 
>>> and even more importantly if I can I restore what was lost.
>> 
>> well, you just get it from the backup. You do daily backups, do
>> you?
>> 
>> Regards,
>> Martin Maechler, ETH Zurich
>>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] [Rd] R CMD build wiped my computer

2010-07-28 Thread Jarrod Hadfield

Hi Martin,

I think this is the most likely reason given that the name in the  
DESCRIPTION file does NOT have a version number. Even so, it is very  
easy to misname a file and then delete it/change its name (as I've  
done here) and I hope current versions of R would not cause this  
problem. Perhaps Fedora should not use ~ as its back up file suffixes?


Cheers,

Jarrod


On 28 Jul 2010, at 11:41, Martin Maechler wrote:


Jarrod Hadfield 
   on Tue, 27 Jul 2010 21:37:09 +0100 writes:



Hi, I ran R (version 2.9.0) CMD build under root in
Fedora (9). When it tried to remove "junk files" it
removed EVERYTHING in my local account! (See below).



Can anyone tell me what happened,


the culprit may lay here:

* removing junk files
unlink MCMCglmm_2.05/R/   residuals.MCMCglmm.R
~


where it seems that someone (you?) have added a newline
in the filname, so instead of
'residuals.MCMCglmm.R~'
you got

'residuals.MCMCglmm.R
~'

and the unlink / rm  command interpreted '~' as your home
directory.

But I can hardly believe it.
This seems explanation seems a bit doubtful to me.. ...


and even more importantly if I can I restore what was lost.


well, you just get it from the backup. You do daily backups, do
you?

Regards,
Martin Maechler, ETH Zurich


Panickingly,



Jarrod



[jar...@localhost AManal]$ R CMD build MCMCglmm_2.05
* checking for file 'MCMCglmm_2.05/DESCRIPTION' ... OK
* preparing 'MCMCglmm_2.05':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to re-build vignettes
* Installing *source* package ?MCMCglmm? ...
** libs
g++ -m64 -I/usr/include/R  -I/usr/local/include-fpic  -O2 -g - 
pipe

-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic -c MCMCglmm.cc -o
MCMCglmm.o
MCMCglmm.cc: In function ?void MCMCglmm(double*, double*, double*,
int*, int*, int*, int*, int*, int*, double*, int*, int*, double*,
int*, int*, double*, double*, int*, int*, int*, int*, int*, int*,
int*, int*, int*, int*, double*, double*, double*, int*, int*, int*,
int*, double*, double*, double*, int*, double*, bool*, double*,
double*, int*, int*, int*, int*, int*, double*, int*, int*, int*,
double*, double*, double*, int*, int*, double*, int*, int*, int*,
int*, double*, double*, double*, double*)?:
MCMCglmm.cc:228: warning: ?pvLS? may be used uninitialized in this  
function
MCMCglmm.cc:227: warning: ?pvLL? may be used uninitialized in this  
function
MCMCglmm.cc:225: warning: ?Lrv? may be used uninitialized in this  
function
MCMCglmm.cc:225: warning: ?pmuL? may be used uninitialized in this  
function
MCMCglmm.cc:225: warning: ?pvL? may be used uninitialized in this  
function
MCMCglmm.cc:225: warning: ?LambdaX? may be used uninitialized in  
this function
MCMCglmm.cc:225: warning: ?bv_tmp? may be used uninitialized in  
this function
MCMCglmm.cc:225: warning: ?bv? may be used uninitialized in this  
function
MCMCglmm.cc:225: warning: ?A? may be used uninitialized in this  
function
MCMCglmm.cc:86: warning: ?dimG? may be used uninitialized in this  
function

MCMCglmm.cc:228: warning: ?AlphainvS? may be used uninitialized in
this function
MCMCglmm.cc:227: warning: ?AlphainvL? may be used uninitialized in
this function
MCMCglmm.cc:225: warning: ?alphalocation_tmp? may be used
uninitialized in this function
MCMCglmm.cc:225: warning: ?alphalocation? may be used uninitialized  
in

this function
MCMCglmm.cc:225: warning: ?alphazstar? may be used uninitialized in
this function
MCMCglmm.cc:225: warning: ?alphapred? may be used uninitialized in
this function
MCMCglmm.cc:225: warning: ?alphaastar? may be used uninitialized in
this function
MCMCglmm.cc:225: warning: ?muAlpha? may be used uninitialized in  
this function
MCMCglmm.cc:225: warning: ?Alphainv? may be used uninitialized in  
this

function
MCMCglmm.cc:225: warning: ?tXalpha? may be used uninitialized in  
this function
MCMCglmm.cc:225: warning: ?Xalpha? may be used uninitialized in  
this function

MCMCglmm.cc:225: warning: ?linky_orig? may be used uninitialized in
this function
MCMCglmm.cc:228: warning: ?tYKrinvYS? may be used uninitialized in
this function
MCMCglmm.cc:228: warning: ?LambdaS? may be used uninitialized in  
this function

MCMCglmm.cc:227: warning: ?tYKrinvYL? may be used uninitialized in
this function
MCMCglmm.cc:227: warning: ?LambdaLU? may be used uninitialized in  
this

function
MCMCglmm.cc:225: warning: ?tYKrinvY? may be used uninitialized in  
this

function
MCMCglmm.cc:225: warning: ?tYKrinv? may be used uninitialized in  
this function
MCMCglmm.cc:225: warning: ?ILY? may be used uninitialized in this  
function
MCMCglmm.cc:225: warning: ?tY? may be used uninitialized in this  
function
MCMCglmm.cc:225: warning: ?Y? may be used uninitialized in this  
function
MCMCglmm.cc:225: warning: ?I? may be used uninitialized in this  
function
MCMCglmm.cc:228: warning: ?alphaS? may be used uninitialized in  
this function
MCMCglmm.cc:225: warning: ?alphaMME? may be use