Service Menu Shred

Dolphin Service Menus

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
5.0
Description:

This will create a KDE-Sub shred service menu. I have not figured out how to get shred to recursively shred all files within folders and sub-folders using the service menu. Usually I just
find ~/Desktop/Trash/ -iname "*" -exec shred {} -v -f -u -z ;
from the command line. I have not figured out how to get this to work from a service menu yet. If someone knows how to get this to work please don't hesitate.

I have made this really easy to install. Just unpack the tar.gz file and run the script as root. It will create a file in $KDEDIR/share/apps/konqueror/servicemenus/ called shred_files.desktop. Thats it, its that easy. Now just right click on any file and select shred.

This should work on any distro.
Last changelog:

14 years ago

0.1 Initial Creation. Only partially functional.

Corven

14 years ago

I've rigged a partially funtional (and partially proper) extension to this project which will shred the contents of subdirectories. The current install does includes this option in the KDE servicemenu, but it's not working. Here's the update...

Edit the bottom portion of shred_files.desktop as so:

[Desktop Action shred-folder-contents]
Name=Shred Folder & All Contents
Icon=stop
Exec=shredfiles %f

Now create a new file, /usr/bin/shredfiles, and don't forget to make it executable!

:::::CODE:::::

BASEDIR=$1
cd $BASEDIR
find -depth -type d > ~/out
cut --bytes=3- ~/out > ~/out
perl -p -e 's/\n/ /' < ~/out > ~/out
perl -p -e 's/ / /' < ~/out > ~/out
arrayZ=( `more ~/out` )
#element_count=${#arrayZ[@]}
#echo '$element_count = '$element_count
for i in "${arrayZ[@]}"
do
cd $BASEDIR/$i
for file in `ls -a`
do
shred -vfuxz $file
done
done
cd $BASEDIR
for file in `ls -a`
do
shred -vfuxz $file
done
rm -fr *
cd ..
rmdir $BASEDIR
shred -vfuxz ~/out

:::::CODE:::::

ISSUES: There are obvious problems with this script. It does not properly handle: links, directories having space(s) in name, and probably lots of stuff I'm not thinking of. Furthermore, it forcibly removes the leftovers that it missed (which means those files are still very much recoverable!).

..anyways, I gave up Windows cold-turkey last month. Today, I'm a happier man. ;)

Report

14 years ago

0.1 Initial Creation. Only partially functional.

12345678910
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
0.1
updated Sep 27 2004
added Sep 27 2004
downloads today
1
page views today 6
System Tags addon