Tragic background
Machines running automated scripts cannot connect to the toast server,
You can only write one script on your own and run it every day.
Of course, it should be placed in crontab.
5 3 * * * sh ~/nosecron.sh
Even more tragic results
The next day, I checked the results and fail was mostly used.
Annoying Analysis
Many of them are caused:
catch_pkts.append(pkt.getlayer(IP).build())
AttributeError: ‘NoneType‘ object has no attribute ‘build‘
Then there is a sentence at the beginning of log:
WARNING: Failed to execute tcpdump. Check it is installed and in the PATH
Run tcpdump manually, OK
Manually executed nosecron. Sh, OK
Add the echo $ path to nosecron. SH and put it in crontab. The only difference is:
/Usr/sbin:/usr/bin
Quick Solution
Add
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Clever Solution
In crontab:
5 3 * * * su - root -c "sh /root/nosecron.sh"
Once and for all
Add the following to the front of crontab:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Unfortunately, I don't know why it doesn't take effect.