Until now the best option I could come up with is trying to use systemd timers to start this
Code: Select all
ss -aenp &>> /var/log/sslog-`date +%F`.log
Code: Select all
systemd-run --on-calendar="*-*-* *:*:*/6" ss -aenp | grep transmi &>> /var/log/sslog-`date +%F`.log
Code: Select all
root@localhost:~# systemd-run --on-calendar="*-*-* *:*:1/6" ss -aenp | grep transmi &>> /var/log/ss-`date +%F`.log
Running timer as unit: run-r4f7f393ed93d4b7ca0e5097ebfa679ec.timer
Will run service as unit: run-r4f7f393ed93d4b7ca0e5097ebfa679ec.service
root@localhost:~# updatedb
root@localhost:~# locate run-r4f7f393ed93d4b7ca0e5097ebfa679ec.timer
root@localhost:~# locate run-r4f7f393ed93d4b7ca0e5097ebfa679ec.service
root@localhost:~#
root@localhost:~# ls -al /var/log/ss-*
-rw-r--r-- 1 root root 0 Apr 30 15:45 /var/log/ss-2020-04-30.log
root@localhost:~#
BTW: this bevaviour is the same on centos 8 and debian 10, (yes crossposted on ubuntu/debian)
What could have went wrong?