Mailinglist Archive: opensuse-security (465 mails)

< Previous Next >
Re: [suse-security] Dot Snapshot
  • From: Lenz Grimmer <grimmer@xxxxxxx>
  • Date: Thu, 6 Dec 2001 10:26:29 +0100
  • Message-id: <20011206102629.B32382@xxxxxxx>
On Wed, Dec 05, JW wrote:

> This would have been beter placed on the suse-linux-e list, I belive.
>
> Anyway, I use this script which I named "trash.sh"
>
> #!/bin/bash
> /bin/mkdir -p ~/trashbin
> /bin/mv "$@"" ~/trashbin/
>
> It could probably be easily modified to get the cwd and stuff the file in $cwd/.trash instead of ~/trashbin.
>
> then if you _really_ want to be safe you can stick this alias in ~/.alias:
>
> alias rm='/usr/local/bin/trash.sh'
>
> Users could still us rm by calling it directly: /bin/rm
>
> And to empty the trashcan:
>
> suse3:~ > cat /usr/local/bin/emptytrash.sh
> #!/bin/bash
> /bin/rm -rf ~/trashbin/*
>
> You could maybe make "purge" a script that got your UID (sounds like an
> awk job), then used your UID with 'find' to find everything you owned
> inside any folder named .trashbin and /bin/rm it.
>
> Sounds fun, maybe I'll hack on it later. If someone else beats me to it
> please post the results to suse-linux-e.

No need to hack on it - here is a (IMHO) more elegant solution: libtrash.

http://www.efpi.org/software/libtrash/

Roman already created RPMs:

ftp://ftp.suse.com/pub/people/draht/7.3/libtrash-0.6-0.i386.rpm

Bye,
LenZ
--
------------------------------------------------------------------
Lenz Grimmer SuSE GmbH
mailto:grimmer@xxxxxxx Schanzaeckerstr. 10
http://www.suse.de/~grimmer/ 90443 Nuernberg, Germany
Winning isn't everything, but wanting to win is.

< Previous Next >
References