git hub reset codes and updated the reset_can script to compress logs

This commit is contained in:
R.P. Clark 2024-12-12 08:50:26 +00:00
parent 3b3037b5b4
commit ab7504ac5b
2 changed files with 35 additions and 2 deletions

16
git_hub_reset_codes.txt Normal file
View File

@ -0,0 +1,16 @@
b2ef2-46e05
1bd6d-f3a35
57c22-85e82
31fde-6551c
78bb1-c8f88
633a1-0c05b
1e3c0-e3e77
e7aad-62ae5
60d1a-9ee24
b8e33-f7b1d
2580a-5fb93
47db7-000df
05667-25d14
08460-3cc2a
e6aba-cc300
7dde9-81492

View File

@ -3,11 +3,28 @@
sudo ip link set can0 down
sudo ip link set can0 type can bitrate 100000 sjw 128
sudo ip link set can0 up
/usr/bin/candump -l -t A can0 &
mkdir -p ~/can_logs
cd ~/can_logs/
d=`date`
echo "-----------------------------------------------------------" >> can_reset_log.txt
ifconfig can0 >> can_reset_log.txt
echo "CAN NOW RESET" $d >> can_reset_log.txt
sudo ip link show can0 >> can_reset_log.txt
echo "-----------------------------------------------------------" >> can_reset_log.txt
# Compress any old log files
#
find . -type f -name "*.log" -exec zip {}.zip {} \;
# delete uncompressed log files
find . -type f -name "*.log" -exec rm -f {} \;
/usr/bin/candump -l -t A can0 &
# Find and delete .log files older than one month
#
find . -type f -name "*.log" -mtime +30 -exec rm -f {} \;
find . -type f -name "*.log.zip" -mtime +30 -exec rm -f {} \;