Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[SOLVED] How can I run bleachbit by crontab 10 minutes after
-
- Posts: 126
- Joined: 2016-09-07 20:24
- Location: Senigallia (AN) - Italy
- Has thanked: 4 times
- Been thanked: 1 time
- Contact:
[SOLVED] How can I run bleachbit by crontab 10 minutes after
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
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.
-
- Posts: 126
- Joined: 2016-09-07 20:24
- Location: Senigallia (AN) - Italy
- Has thanked: 4 times
- Been thanked: 1 time
- Contact:
Re: How can I run bleachbit by crontab 10 minutes after star
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!Segfault wrote:Running bleachbit on servers ... what's the idea?
Regards.
GabrieleMax
Re: How can I run bleachbit by crontab 10 minutes after star
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.)
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.)
-
- Posts: 126
- Joined: 2016-09-07 20:24
- Location: Senigallia (AN) - Italy
- Has thanked: 4 times
- Been thanked: 1 time
- Contact:
Re: How can I run bleachbit by crontab 10 minutes after star
Please can you explain me why you got dubts about it? I use some scripts and they works well...dasein wrote:I'm skeptical of running bleachbit at all, but if you insist on doing it...
Yes... it's really true...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.
I didn't know nice, I'm reading about it and it should be the best way to solve my "problem"!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.)
Many thanks!
Regards.
GabrieleMax
Re: How can I run bleachbit by crontab 10 minutes after star
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:Please can you explain me why you got dubts about it? I use some scripts and they works well...dasein wrote:I'm skeptical of running bleachbit at all, but if you insist on doing it...
Then please take a moment to mark your thread as [SOLVED]. (Edit the subject line of your initial post)GabrieleMax wrote:I didn't know nice, I'm reading about it and it should be the best way to solve my "problem"!
Re: How can I run bleachbit by crontab 10 minutes after star
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.
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.
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: How can I run bleachbit by crontab 10 minutes after star
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,
=======
======
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
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,...
???
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 : as keywords.
I do not understand the "logic" or lack of, in the OP's approach,..sorry.
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
Note:cron example (Linux)
To vacuum Firefox each night at 03:00, run:and add this line:Code: Select all
crontab -e
Code: Select all
0 3 * * * bleachbit --clean firefox.vacuum
Something else that is confusing, is it the servers, or the laptop the OP wantsLinux
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).
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,...
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"GabrieleMax »---- a good idea it could start at screensaver time!
???
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?
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.by millpond »--and bleachbit is certainly a useful operation to include in a more comprehensive script.
I do not understand the "logic" or lack of, in the OP's approach,..sorry.
Re: How can I run bleachbit by crontab 10 minutes after star
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.
Re: How can I run bleachbit by crontab 10 minutes after star
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.
-
- Posts: 126
- Joined: 2016-09-07 20:24
- Location: Senigallia (AN) - Italy
- Has thanked: 4 times
- Been thanked: 1 time
- Contact:
Re: How can I run bleachbit by crontab 10 minutes after star
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: 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 did it!dasein wrote: Then please take a moment to mark your thread as [SOLVED]. (Edit the subject line of your initial post)
-
- Posts: 126
- Joined: 2016-09-07 20:24
- Location: Senigallia (AN) - Italy
- Has thanked: 4 times
- Been thanked: 1 time
- Contact:
Re: How can I run bleachbit by crontab 10 minutes after star
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: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.
When I run bleachbit on a server I schedule scripts at late night when there isnt't activity.millpond wrote: Ideally this operation should be done at startup, shutdown, or during maintenance hours on a server.
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: There is nothing wrong with using cron for maintenance activities, and bleachbit is certainly a useful operation to include in a more comprehensive script.
I don't know this method... but I'll "study" it!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'll try 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).
Many thanks for everything!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.
- sunrat
- Administrator
- Posts: 6412
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 116 times
- Been thanked: 462 times
Re: How can I run bleachbit by crontab 10 minutes after star
Isn't that what logrotate is for?millpond wrote:One possible other scenario is a server that deliberately desires to frequently wipe logs.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!