[SOLVED] How can I run bleachbit by crontab 10 minutes after

If none of the more specific forums is the right place to ask

[SOLVED] How can I run bleachbit by crontab 10 minutes after

Postby GabrieleMax » 2017-03-28 18:51

Hi everybody! :)

Usually I use bleachbit scheduled on servers at night by crontab job, I use it also on my laptop when I need it but... I should use it also on a "end user" pc/laptop but without user works!

Maybe I could load bleachbit on startup but yuo know startup is a heavy time for a pc and I would run bleachbit after 10-15 minutes or a good idea it could start at screensaver time!

Is it possible to do it?

Regards.
GabrieleMax
Last edited by GabrieleMax on 2017-03-29 20:01, edited 1 time in total.
GabrieleMax
 
Posts: 34
Joined: 2016-09-07 20:24
Location: Senigallia

Re: How can I run bleachbit by crontab 10 minutes after star

Postby Segfault » 2017-03-28 19:02

Running bleachbit on servers ... what's the idea?
Segfault
 
Posts: 412
Joined: 2005-09-24 12:24

Re: How can I run bleachbit by crontab 10 minutes after star

Postby GabrieleMax » 2017-03-28 19:04

Segfault wrote:Running bleachbit on servers ... what's the idea?


Bleachbit works well on my servers, I need to use it on user's pc and I'd like to run it in silent mode after 10-15 or when there's screensaver mode!

Regards.
GabrieleMax
GabrieleMax
 
Posts: 34
Joined: 2016-09-07 20:24
Location: Senigallia

Re: How can I run bleachbit by crontab 10 minutes after star

Postby Segfault » 2017-03-28 19:08

You mean you feel the need to run bleachbit on Linux servers?! Those servers are misconfigured somehow or what?
Segfault
 
Posts: 412
Joined: 2005-09-24 12:24

Re: How can I run bleachbit by crontab 10 minutes after star

Postby dasein » 2017-03-28 19:27

I'm skeptical of running bleachbit at all, but if you insist on doing it...

A(ny) time-based scheme is going to be inherently suboptimal, since you have no idea what this hypothetical user might be doing 10 (or 5, or 33) minutes after startup.

Seems to me that the vastly more sensible approach would be to invoke via script at user login and nice it to the point that it runs only when the CPU has nothing else to do. (See man nice for details.)
User avatar
dasein
 
Posts: 7272
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: How can I run bleachbit by crontab 10 minutes after star

Postby GabrieleMax » 2017-03-28 19:41

dasein wrote:I'm skeptical of running bleachbit at all, but if you insist on doing it...

Please can you explain me why you got dubts about it? I use some scripts and they works well...

dasein wrote:A(ny) time-based scheme is going to be inherently suboptimal, since you have no idea what this hypothetical user might be doing 10 (or 5, or 33) minutes after startup.

Yes... it's really true...

dasein wrote:Seems to me that the vastly more sensible approach would be to invoke via script at user login and nice it to the point that it runs only when the CPU has nothing else to do. (See man nice for details.)

I didn't know nice, I'm reading about it and it should be the best way to solve my "problem"! :)

Many thanks!
Regards.
GabrieleMax
GabrieleMax
 
Posts: 34
Joined: 2016-09-07 20:24
Location: Senigallia

Re: How can I run bleachbit by crontab 10 minutes after star

Postby dasein » 2017-03-28 20:06

GabrieleMax wrote:
dasein wrote:I'm skeptical of running bleachbit at all, but if you insist on doing it...

Please can you explain me why you got dubts about it? I use some scripts and they works well...

Unless the content in question is explicitly temporary (the contents of /tmp, for instance), I think that automating anything destructive is shortsighted. And given how inexpensive disk space is, there's really no benefit to saving a fraction of a penny's worth of disk space.

GabrieleMax wrote:I didn't know nice, I'm reading about it and it should be the best way to solve my "problem"! :)

Then please take a moment to mark your thread as [SOLVED]. (Edit the subject line of your initial post)
User avatar
dasein
 
Posts: 7272
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: How can I run bleachbit by crontab 10 minutes after star

Postby millpond » 2017-03-28 23:21

The OP should really reconsider the wisdom of running a system cleaning process during normal operations. Things like logs and temp files and what-not are *used* by running processes, and deleting them is something of a recipe for disaster.

Ideally this operation should be done at startup, shutdown, or during maintenance hours on a server.
There is nothing wrong with using cron for maintenance activities, and bleachbit is certainly a useful operation to include in a more comprehensive script.

One possible other scenario is a server that deliberately desires to frequently wipe logs. Particularly as turning off logging is often difficult. One option for this is to mount the /var/logs directory to ram, and wipe it periodically.

There is a utility called ramlog for this purpose, but its written as a PPA and the script needs to be fixed for use with Debian. Its a shell script, so thats no biggie. Here its configured to a minimum size, and effectively wiped at shutdown.
https://www.linux.com/news/improve-syst ... -files-ram
(Its sysvinit, which I use here. No clue as to how it works with systemd).

A newer variant would be:
http://www.linux-magazine.com/Online/Bl ... -LogRunner
The archive directory -gzpath, can be set to /dev/null. Its a python script.
millpond
 
Posts: 582
Joined: 2014-06-25 04:56

Re: How can I run bleachbit by crontab 10 minutes after star

Postby bw123 » 2017-03-28 23:31

I'm with segfault, why? What does bleachblt have a need to do after 10 min ?
jessie/KDE4.14.2 plasma netbook, 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux
User avatar
bw123
 
Posts: 2378
Joined: 2011-05-09 06:02
Location: TN_USA

Re: How can I run bleachbit by crontab 10 minutes after star

Postby GarryRicketson » 2017-03-29 00:25

There is a lot that is not clear on this, so I don't see any way any one can say exactly how, or write some script for the OP, which is what it sound like they want.
It does not matter , why , but the important part, that does matter is: What does the OP want "bleach bit" to do, at the time crontab is set to run.
So the OP needs to look at the manual for bleach bit, and see what commands
are available, decide which ones to run,..then also read the manual on crontab,
Code: Select all
man bleachbit

=======
Code: Select all
man crontab

======
Basically it is simple, but it might be some what more complex depending
on what bleachbit commands need to be run.
A simple example:
From: http://www.bleachbit.org/documentation/command-line
cron example (Linux)

To vacuum Firefox each night at 03:00, run:
Code: Select all
crontab -e

and add this line:
Code: Select all
0 3 * * * bleachbit --clean firefox.vacuum


Note:
Linux

Running bleachbit (which is in the path) with arguments runs BleachBit in command line mode. Without arguments, BleachBit runs in graphical mode. The clipboard can only be cleaned under an X session (which is generally not available over SSH or in cron).

Something else that is confusing, is it the servers, or the laptop the OP wants
to do this,..Normally a server is running 24hours daily, and is not shutdown and
rebooted every day,..doing this at "startup", would not be very often,..but to use
crontab, you would have to know what time the "start up" will occur, and the
set crontab accordingly,...IE: if "startup" is at 8am, you would want to set crontab
so it runs the command or commands at 8:10 am,...

GabrieleMax »---- a good idea it could start at screensaver time!

I am inclined to think this means the OP is not talking about doing this on a server, but on their laptop, servers do not normally use any "screensavers"
???
In any event, the OP could do some searches, and maybe find some examples that will help,
how to run bleachbit by crontab
or use :
Code: Select all
 How can I run bleachbit by crontab 10 minutes after startup?
as keywords.

by millpond »--and bleachbit is certainly a useful operation to include in a more comprehensive script.

I don't think I would use bleachbit , myself for this, but there is nothing wrong with that, but even if it was not going to be done with bleachbit, we would need a more comprehensive description of what commands the OP wants to run using crontab, so they could be included in a script.
I do not understand the "logic" or lack of, in the OP's approach,..sorry.
User avatar
GarryRicketson
 
Posts: 3772
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: How can I run bleachbit by crontab 10 minutes after star

Postby Segfault » 2017-03-29 02:10

What exactly is what bleachbit can do and a properly configured server cannot? There are millions of Linux servers running and they can keep their nose clean without bleaching.
Segfault
 
Posts: 412
Joined: 2005-09-24 12:24

Re: How can I run bleachbit by crontab 10 minutes after star

Postby debiman » 2017-03-29 14:58

i know this is just a rant, but imo bleachbit has been designed by and is geared towards linux (cough... ubuntu) users that cannot let go of the old windows user paradigm that the operating system is working against them, and therefor they constantly have to work against the operating system.
User avatar
debiman
 
Posts: 834
Joined: 2013-03-12 07:18

Re: How can I run bleachbit by crontab 10 minutes after star

Postby GabrieleMax » 2017-03-29 20:11

dasein wrote:Unless the content in question is explicitly temporary (the contents of /tmp, for instance), I think that automating anything destructive is shortsighted. And given how inexpensive disk space is, there's really no benefit to saving a fraction of a penny's worth of disk space.

I understood what you said but sometime end user cleans nothing on his o.s. and I think to clear old packets, cache, etc. could be a good idea... I got in my mind my first pc a IBM PS/1 with just 40MB of hard drive with everyday problems of free space! :)

dasein wrote:Then please take a moment to mark your thread as [SOLVED]. (Edit the subject line of your initial post)

I did it! :)
GabrieleMax
 
Posts: 34
Joined: 2016-09-07 20:24
Location: Senigallia

Re: How can I run bleachbit by crontab 10 minutes after star

Postby GabrieleMax » 2017-03-29 20:25

millpond wrote:The OP should really reconsider the wisdom of running a system cleaning process during normal operations. Things like logs and temp files and what-not are *used* by running processes, and deleting them is something of a recipe for disaster.


Ok but if you clean cache or old packets you can save a lot of space and it's not dangerous on a end user pc, I don't erase logs!

millpond wrote:Ideally this operation should be done at startup, shutdown, or during maintenance hours on a server.

When I run bleachbit on a server I schedule scripts at late night when there isnt't activity.

millpond wrote:There is nothing wrong with using cron for maintenance activities, and bleachbit is certainly a useful operation to include in a more comprehensive script.

Finally someone who don't hate bleachbit! :) Can I ask you something about "more comprehensive script"? I'd like to know your idea about how to clean a system...

millpond wrote:One possible other scenario is a server that deliberately desires to frequently wipe logs. Particularly as turning off logging is often difficult. One option for this is to mount the /var/logs directory to ram, and wipe it periodically.

I don't know this method... but I'll "study" it! :)

millpond wrote:There is a utility called ramlog for this purpose, but its written as a PPA and the script needs to be fixed for use with Debian. Its a shell script, so thats no biggie. Here its configured to a minimum size, and effectively wiped at shutdown.
https://www.linux.com/news/improve-syst ... -files-ram
(Its sysvinit, which I use here. No clue as to how it works with systemd).

I'll try it! :)

millpond wrote:A newer variant would be:
http://www.linux-magazine.com/Online/Bl ... -LogRunner
The archive directory -gzpath, can be set to /dev/null. Its a python script.

Many thanks for everything! :)
GabrieleMax
 
Posts: 34
Joined: 2016-09-07 20:24
Location: Senigallia

Re: How can I run bleachbit by crontab 10 minutes after star

Postby sunrat » 2017-03-29 23:17

millpond wrote:One possible other scenario is a server that deliberately desires to frequently wipe logs.

Isn't that what logrotate is for?
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 1866
Joined: 2006-08-29 09:12
Location: Melbourne, Australia


Return to General Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable