0
$\begingroup$

Rosanswers logo

How can you administrate usage of the ros logging dir (~/.ros/log)?

At the moment I suspect its only possible via the warning that roscore gives you on startup and use of rosclean. Is there an automated means of management?

Solution

Cannot set a maximum on the logging space, but as GeniusGeeko mentions below, you can wipe old logs fairly effectively using simple *nix magic. Put the following line in your user .bashrc:

find ~/.ros/log/* -mtime +5 -exec rm -rf {} \;

This will clean out any logs older than 5 days old. Alternatively you can put it in your system startup script (on ubuntu /etc/rc.local), just remember to convert the "~" to an explicit folder name pointing to your logs.


Originally posted by Daniel Stonier on ROS Answers with karma: 3170 on 2011-03-17

Post score: 5


Original comments

Comment by GeniusGeeko on 2011-03-18:
How often would you like to "rosclean" your logs?

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Just to do this..

echo "find ~/.ros/log/* -mtime +5 -exec rm -r {} \;" >> ~/.bashrc

Replace the 5 with how many days you want to remove that was created before that number. This will remove files older than 5 days old.

It will search for old files every time you open a terminal.


Originally posted by GeniusGeeko with karma: 299 on 2011-03-18

This answer was ACCEPTED on the original site

Post score: 7


Original comments

Comment by joq on 2011-03-18:
Good idea using find. I probably would not add it to my ~/.bashrc, but that would make a nice alias.

$\endgroup$
0
$\begingroup$

Rosanswers logo

You can modify the logging configuration of both roscpp and rospy via their logging configuration files in $ROS_ROOT/config . That should enable you to disable or otherwise reduce the logging.


Originally posted by kwc with karma: 12244 on 2011-03-18

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.