ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
5

Administrating the logging directory

asked 2011-03-17 11:45:31 -0500

Daniel Stonier gravatar image

updated 2011-03-20 19:03:26 -0500

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.

edit retag flag offensive close merge delete

Comments

How often would you like to "rosclean" your logs?
GeniusGeeko gravatar image GeniusGeeko  ( 2011-03-18 05:44:23 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
7

answered 2011-03-18 07:37:27 -0500

updated 2011-03-18 07:50:55 -0500

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.

edit flag offensive delete link more

Comments

Good idea using find. I probably would not add it to my ~/.bashrc, but that would make a nice alias.
joq gravatar image joq  ( 2011-03-18 10:07:49 -0500 )edit
1

answered 2011-03-18 04:52:51 -0500

kwc gravatar image

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.

edit flag offensive delete link more
0

answered 2011-03-18 07:22:17 -0500

joq gravatar image

I usually just periodically list that directory in emacs (dired), sort everything by date, and delete everything more than about a month old.

It would be cool to have a simple command or option to do that. If someone has one, please let us know.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-03-17 11:45:31 -0500

Seen: 1,269 times

Last updated: Mar 20 '11