Robobot logfile cleanup

From Rsewiki

Back to Robobot

Logfiles

Many logfiles will accumulate over time.

To clean up these files, there are two scripts in the setup directory.

A total cleanup could be:

cd ~/svn/robobot/setup
./clean_

Files owned by local

This script removes all images from the mqtt_python directory and automatically generated log files.

clean_logfiles.bash:
#!/bin/bash
# clean logfiles before flash image
# teensy_interface
rm -r /home/local/svn/robobot/teensy_interface/build/log_20*
rm /home/local/svn/robobot/teensy_interface/build/out_*.txt
# mqtt_python
rm /home/local/svn/robobot/mqtt_python/image*.jpg
rm /home/local/svn/robobot/mqtt_python/log*.txt
# log
rm -r /home/local/svn/log/log_20*
rm /home/local/svn/log/ip_disp.out
rm /home/local/svn/log/log_*.txt
rm /home/local/svn/log/rebootinfo.txt
# these are owned by root
# rm /home/local/svn/log/rename_info.txt
# rm /home/local/svn/log/off_by*.txt
echo "all clean (except svn/log/rename_info.txt and off_by*.txt that is owned by root)"

Files owned by root

The host rename and off_by_mqtt run as user 'root', so the files are owned by 'root'. These need to be removed with the sudo command.

clean_logfiles_sudo.bash:
#!/bin/bash
# clean logfiles before flash image
# these are owned by root
rm /home/local/svn/log/rename_info.txt
rm /home/local/svn/log/off_by*.txt
echo "all root-logfiles clean"