Help - we lost all our files!

Buster Irby rli at buster.stafford.tx.us
Mon Jul 1 00:51:53 AEST 1991


dickson at escob1.UUCP (Dave Dickson) writes:

>[ description of lost files deleted ]

>We are reasonably certain that this was not an intruder or other
>nefarious critter, as we have a reasonably secure system (I, know,
>famous last words).

>Anyway, any help or suggestions as to the cause of this would be
>appreciated.

>CRONTAB ENTRY:
>45 3 * * * find /tmp/* /usr/tmp/* -mtime +1 -print | xargs rm -r

The cause of the problem is that you executed this cron as root
and therefore it began processing from the root environment.  The
*BUG* then caused rm -r to be executed from '.' which equated to
'/'.  If you would take a more defensive posture and always cd to
one of the tmp directories, this could not have happened.

45 3 * * * cd /tmp; find /tmp/* /usr/tmp/* -mtime +1 -print | xargs rm -r

In this case, the worst that would have happened is it would have 
erased everything in /tmp.



More information about the Comp.unix.admin mailing list