[SOLVED] Cron <root@pve> /usr/bin/truncLog sending email every 10min

babyvox550

New Member
Nov 30, 2022
21
2
3
Cron <root@pve> /usr/bin/truncLog

rm: cannot remove '/var/log/*.gz': No such file or directory
rm: cannot remove '/var/cache/apt/archives/*.deb': No such file or directory
rm: cannot remove '/var/cache/apt/archives/partial/*.deb': No such file or directory
rm: cannot remove '/var/log/*.1': No such file or directory
rm: cannot remove '/var/log/*.2': No such file or directory
rm: cannot remove '/var/log/*.3': No such file or directory
rm: cannot remove '/var/log/*.4': No such file or directory
rm: cannot remove '/var/log/*.5': No such file or directory
rm: cannot remove '/var/log/*.6': No such file or directory
/var/log
/var/log/apt
/var/log/ceph
/var/log/chrony
/var/log/corosync
/var/log/cups
/var/log/glusterfs
/var/log/hp
/var/log/hp/tmp
/var/log/journal
/var/log/journal/4e178ea614734574a2de8d1370102479
/var/log/lxc
/var/log/openvswitch
/var/log/private
/var/log/pve
/var/log/pve/tasks
/var/log/pve/tasks/0
/var/log/pve/tasks/1
/var/log/pve/tasks/2
/var/log/pve/tasks/3
/var/log/pve/tasks/4
/var/log/pve/tasks/5
/var/log/pve/tasks/6
/var/log/pve/tasks/7
/var/log/pve/tasks/8
/var/log/pve/tasks/9
/var/log/pve/tasks/A
/var/log/pve/tasks/B
/var/log/pve/tasks/C
/var/log/pve/tasks/D
/var/log/pve/tasks/E
/var/log/pve/tasks/F
/var/log/pveproxy
/var/log/runit
/var/log/runit/ssh
/var/log/samba
/var/log/samba/cores
/var/log/samba/cores/nmbd
/var/log/samba/cores/smbd
/var/log/sysstat
/var/log/unattended-upgrades

this rmail is sending every 10mins

Is there any problem? how to solve it?

Last login: Mon Jan 9 09:58:01 2023 from 10.0.0.88 root@pve:~# pveversion -v proxmox-ve: 7.3-1 (running kernel: 6.1.0-1-pve) pve-manager: 7.3-4 (running version: 7.3-4/d69b70d4) pve-kernel-6.1: 7.3-1 pve-kernel-5.15: 7.3-1 pve-kernel-helper: 7.3-1 pve-kernel-6.1.0-1-pve: 6.1.0-1 pve-kernel-5.15.83-1-pve: 5.15.83-1 pve-kernel-5.15.74-1-pve: 5.15.74-1 ceph-fuse: 15.2.17-pve1 corosync: 3.1.7-pve1 criu: 3.15-1+pve-1 glusterfs-client: 9.2-1 ifupdown2: 3.1.0-1+pmx3 ksm-control-daemon: 1.4-1 libjs-extjs: 7.0.0-1 libknet1: 1.24-pve2 libproxmox-acme-perl: 1.4.3 libproxmox-backup-qemu0: 1.3.1-1 libpve-access-control: 7.3-1 libpve-apiclient-perl: 3.2-1 libpve-common-perl: 7.3-1 libpve-guest-common-perl: 4.2-3 libpve-http-server-perl: 4.1-5 libpve-storage-perl: 7.3-1 libspice-server1: 0.14.3-2.1 lvm2: 2.03.11-2.1 lxc-pve: 5.0.0-3 lxcfs: 4.0.12-pve1 novnc-pve: 1.3.0-3 openvswitch-switch: 2.15.0+ds1-2+deb11u1 proxmox-backup-client: 2.3.2-1 proxmox-backup-file-restore: 2.3.2-1 proxmox-mini-journalreader: 1.3-1 proxmox-widget-toolkit: 3.5.3 pve-cluster: 7.3-1 pve-container: 4.4-2 pve-docs: 7.3-1 pve-edk2-firmware: 3.20220526-1 pve-firewall: 4.2-7 pve-firmware: 3.6-2 pve-ha-manager: 3.5.1 pve-i18n: 2.8-1 pve-qemu-kvm: 7.1.0-4 pve-xtermjs: 4.16.0-1 qemu-server: 7.3-2 smartmontools: 7.2-pve3 spiceterm: 3.2-2 swtpm: 0.8.0~bpo11+2 vncterm: 1.7-1 zfsutils-linux: 2.1.7-pve2


Screenshot_20230109_123329_edit_59588920835698.jpg
 
Last edited:
cat /usr/bin/truncLog


#!/bin/bash

isFile(){
L=`cat $1|wc -l`
n=$(($L - 300))
if [ $n -gt 0 ];then
sed -i "1,${n}d" $1
fi
}

isDir(){
echo $1
for i in `ls $1`
do
if [ -f $1/$i ];then
isFile $1/$i
else
isDir $1/$i
fi
done
}
rm /var/log/*.gz
rm /var/cache/apt/archives/*.deb
rm /var/cache/apt/archives/partial/*.deb
for i in {1..6}
do
rm /var/log/*.$i
done
isDir '/var/log'That is not a binary shipped by any Proxmox project directly.

What does dpkg -S truncLog output?
 
That is not a binary shipped by any Proxmox project directly.

What does dpkg -S truncLog output?
When I rename truncLog as truncLog1, email says "/bin/sh: 1: /usr/truncLog: not found"

Please indicate how to find which software is running and deleting all my logs.
 
Yeah, not being found by dpkg means that a binary is not coming from a DEB package, so most often manually installed third party stuff - as you found out yourself.

You can mark this thread as solved using the Edit Thread button at the top right to set the Solved prefix.
 
Yeah, not being found by dpkg means that a binary is not coming from a DEB package, so most often manually installed third party stuff - as you found out yourself.

You can mark this thread as solved using the Edit Thread button at the top right to set the Solved prefix.
thanks
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!