Compare commits
No commits in common. "ae790faf896e66a842177930c2e8098d50fdbc5b" and "6aac0a2032bda80e5c59b5628af1fd4745d5652a" have entirely different histories.
ae790faf89
...
6aac0a2032
@ -1,25 +0,0 @@
|
|||||||
# Edit this file to introduce tasks to be run by cron.
|
|
||||||
#
|
|
||||||
# Each task to run has to be defined through a single line
|
|
||||||
# indicating with different fields when the task will be run
|
|
||||||
# and what command to run for the task
|
|
||||||
#
|
|
||||||
# To define the time you can provide concrete values for
|
|
||||||
# minute (m), hour (h), day of month (dom), month (mon),
|
|
||||||
# and day of week (dow) or use '*' in these fields (for 'any').
|
|
||||||
#
|
|
||||||
# Notice that tasks will be started based on the cron's system
|
|
||||||
# daemon's notion of time and timezones.
|
|
||||||
#
|
|
||||||
# Output of the crontab jobs (including errors) is sent through
|
|
||||||
# email to the user the crontab file belongs to (unless redirected).
|
|
||||||
#
|
|
||||||
# For example, you can run a backup of all your user accounts
|
|
||||||
# at 5 a.m every week with:
|
|
||||||
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
|
|
||||||
#
|
|
||||||
# For more information see the manual pages of crontab(5) and cron(8)
|
|
||||||
#
|
|
||||||
# m h dom mon dow command
|
|
||||||
25 8 * * * /home/robin/reset_can.sh >> /home/robin/can_logs/cronlog.log 2>&1
|
|
||||||
#34 10 * * * /home/robin/reset_can.sh >> /home/robin/can_logs/cronlog.log 2>&1
|
|
@ -1,39 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# crontab starts bash minimally, so
|
|
||||||
export PATH=/usr/local/bin:/usr/bin:/bin
|
|
||||||
|
|
||||||
# debugging
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
sudo ip link set can0 down || { echo "Failed to bring down CAN interface"; exit 1; }
|
|
||||||
|
|
||||||
# NON FD or classical only set up
|
|
||||||
# sudo ip link set can0 type can bitrate 100000 sjw 128
|
|
||||||
sudo ip link set can0 type can bitrate 100000 sjw 128 dbitrate 400000 fd on
|
|
||||||
sudo ip link set can0 up
|
|
||||||
|
|
||||||
mkdir -p ~/can_logs
|
|
||||||
cd ~/can_logs/
|
|
||||||
|
|
||||||
d=`date`
|
|
||||||
|
|
||||||
echo "-----------------------------------------------------------" >> can_reset_log.txt
|
|
||||||
/usr/sbin/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.zip files older than one month
|
|
||||||
#
|
|
||||||
find . -type f -name "*.log.zip" -mtime +30 -exec rm -f {} \;
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
sudo ip link set can0 down
|
sudo ip link set can0 down
|
||||||
# NON FD or classical only set up
|
sudo ip link set can0 type can bitrate 100000 sjw 128
|
||||||
# sudo ip link set can0 type can bitrate 100000 sjw 128
|
|
||||||
sudo ip link set can0 type can bitrate 100000 sjw 128 dbitrate 400000 fd on
|
|
||||||
sudo ip link set can0 up
|
sudo ip link set can0 up
|
||||||
|
|
||||||
mkdir -p ~/can_logs
|
mkdir -p ~/can_logs
|
||||||
|
Loading…
Reference in New Issue
Block a user