Le mar 19/08/2003 à 13:49, Yves Rutschle a écrit : > On Tue, Aug 19, 2003 at 12:42:21PM +0100, Nicolas Rueff wrote: > > Ça expliquerait pourquoi recover marche moyennement chez moi. Bon, je > > vais me bricoler un rm custom, moi > > Si ça interesse des gens: > > > #! /usr/bin/perl > > mkdir "/tmp/removed" unless -d "/tmp/removed"; > > foreach ( @ARGV ) { > next if not -e $_; > s/\/$//; > > if ( s/(.*)\/// ) { > chdir $1; > } > > my $move_to = "/tmp/removed/$_.1"; > if ( -e "$move_to" ) { > $move_to =~ s/(\d+)$/$1+1/e; > } > print "mv $_ $move_to\n"; > `mv $_ $move_to`; > } > > > que je mets dans ~/bin/del, puis alias rm="del". Ça garde > tous les fichiers et répertoires avec un numéro de série (si > on efface 5 fichiers toto, on se retrouve avec > /tmp/removed/toto.1 toto.2 ...) On combine ça avec > tmpreaper. C'est pas particulièrement evolué, mais ça > marche. Non, je pensais plutôt à une solution gérant la taille de la poubelle. J'ai déjà une version en bash, mais comme bash gère assez mal les espaces dans les noms, je vais bientôt le convertir en perl ;) /N ______________________________________________________________________ Nicolas Rueff <n.rueff@tuxfamily.org> http://rueff.tuxfamily.org +33 6 77 64 44 80 -- There once was a man who went to a computer trade show. Each day as he entered, the man told the guard at the door: "I am a great thief, renowned for my feats of shoplifting. Be forewarned, for this trade show shall not escape unplundered." This speech disturbed the guard greatly, because there were millions of dollars of computer equipment inside, so he watched the man carefully. But the man merely wandered from booth to booth, humming quietly to himself. When the man left, the guard took him aside and searched his clothes, but nothing was to be found. On the next day of the trade show, the man returned and chided the guard saying: "I escaped with a vast booty yesterday, but today will be even better." So the guard watched him ever more closely, but to no avail. On the final day of the trade show, the guard could restrain his curiosity no longer. "Sir Thief," he said, "I am so perplexed, I cannot live in peace. Please enlighten me. What is it that you are stealing?" The man smiled. "I am stealing ideas," he said. -- Geoffrey James, "The Tao of Programming" ______________________________________________________________________
Attachment:
signature.asc
Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=