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

How to archive log directory from shell script?

asked 2015-06-12 10:41:32 -0600

lapadets gravatar image

I have a shell script that starts a roslaunch file. I use a shell script, because I provide some arguments before I start the roslaunch.

I'd like to also archive and copy the current log directory for the running roscore process. I know that by running roscd log, I get to the this current directory, but I cannot somehow get to this directory from the shell script.

I tried assigning it to a variable:

log_dir=$(roscd log)

and then running tar -zcvf $log_dir -C $output_dir

But of course nothing is stored in my variable. I am not sure even if this is the correct approach. But I am asking here, as there might be some better ROS specific way of doing such a task.

So, what is the best way to this? Since the name of the log folder is always dynamically generated.

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-06-12 15:12:29 -0600

lucasw gravatar image
roscd log
log_dir=`pwd`
edit flag offensive delete link more

Comments

Thank you!

lapadets gravatar image lapadets  ( 2015-06-15 03:34:36 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-06-12 10:41:32 -0600

Seen: 323 times

Last updated: Jun 12 '15