SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-10-27 10:55:32

dan158
#! Member
Registered: 2012-06-08
Posts: 50

A tinny cleaning script

Here is a little clean up script I've been using. I have it linked to a menu item I called "Clean Up" and put at the very to of my Openbox Menu list.
First I downloaded several cleaning programs;

I used Synaptic to install;

 bleachbit
 and ClamAV, clamav-base, clamav-docs, python-clamav, libclamav-client-perl, clamav-daemon, clamav-freshclam, clamtk, python-pyclamd, clamav-unofficial-sigs, libclamav-dev, libclamav6   

some of those might be unneccessary. I searched Clamav in Synaptic and installed all of them i thought would apply to the usage I intend for this #! instance.

then I opend my editor (geany) and made my script;

#! /bin/bash

su-to-root -X -c bleachbit &
bleachbit
clamtk %F

I named it cleanup.bash and made it executable

Right click the file after saving choose "Properties > 'permissions tab' > [check-box] allow to execute"
OR 
Open terminal and type; sudo chmod +x /path/to/your/[b]cleanup.bash[/b]

then I moved it to /usr/bin

in a terminal; sudo mv /location/of/your/[b]cleanup.bash[/b] /usr/bin

Now every time I close my laptop down I hit the hot-keys to open my menu and Clean Up is highlighted already, I just hit enter and the I'm asked for my password, the 2 Bleachbit pages open.
The first one (root) clears my / partition and the second one does /home.
The one on top is convieniently the Bleachbit (root), {which you realy want to run first}.
I figured out that I just hit "[Right arrow] [Enter]" twice for each Bleach bit page and it does it's thing quick and easy (you do have to set them up the first time).
[Ctrl]-q closes the Bleachbit page and after the second one ClamAV opens and with a quick [Ctrl]-z it does a recursive scrubbing of my /home and I'm ready to shut it down (or deal with the unlikely problem clamav might find, if one arises)

to get your cleanup.bash sript into your menu;
open "Menu > settings > openbox > 'GUI Menu editor' "  and enter the name of your script (mine was cleanup.bash) and a title for it. Or edit your menu.xml

To me cleaning my comps after being on the internet is a little like washing my hands after using the bathroom; It takes a moment, but every once in a while it's worth while. You usualy dont know when that is either.I hope this isn't to simple or a waist of space.

I would like to know how to include a "su-to-root -X -c chkrootkit" command included in there without having to type my password twice.

thanks for reading, and letting me share.

Offline

Help fund CrunchBang, donate to the project!

#2 2012-10-27 12:32:55

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,492

Re: A tinny cleaning script

I would like to know how to include a "su-to-root -X -c chkrootkit" command included in there without having to type my password twice.

You could consider using 'sudo' in stead of 'su-to-root'.

'sudo' can be configured to ask either for  the root password or the user password.
It caches thepassword for a configurable time period so that you would have to enter the password at most once.
It can also be configured so that your user does not have to enter a password at all.

Configuration is done with the special program 'visudo'.
Configuration is not always evident and it is possible - indeed it is very easy - to configure it so that you lock yourself out of your system, and the only way to recover from it is booting from a live system and chrooting into the installed system.

Dont use visudo in a hurry. Read up on it before you use it. Make up your mind exactly how you want to configure it.

Cleaning up your system regularly is best done using cron or anacron. Debian already has some cleaning installed by default. See /etc/cron.d/{hourly,daily,monthly}. It is easy to add tasks, and... no problem with passwords because cron/anacron runs under root already.

hth

Online

#3 2012-10-27 13:22:57

dan158
#! Member
Registered: 2012-06-08
Posts: 50

Re: A tinny cleaning script

Hey, Thanks xaos52!
I always learn so much when I bumbble around here. smile
Thanks for taking the time to point me in the right direction.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo