nice

#!/bin/sh
ps -s $1 -o pid | xargs ionice -c 2 -n 0 -p

@hourly for u in $(tail -n +30 /etc/passwd | grep bash | cut -d”:” -f 1) ; do renice -10 -u $u ; done

every minute top

#!/bin/bash
EXECUTE_ON_AVERAGE="1" # if cpu load average for last 60 secs is 
                         # greater or equal to this value, execute script
                         # change it to whatever you want :-)

while true; do
#  if [ $(echo "$(uptime | cut -d " " -f 13 | cut -d "," -f 1) >= $EXECUTE_ON_AVERAGE" | bc) = 1 ]; then
#    /usr/bin/sysdig -G 60 -W 2880 -w /root/dump.scap
if [ $(echo "$(uptime | cut -d " " -f 13 | cut -d "," -f 1) >= $EXECUTE_ON_AVERAGE" | bc) = 1 ]; then
    (/usr/bin/nvidia-smi >> /root/memlog.txt) && (/usr/bin/free -mt >> /root/memlog.txti)
  else
#    killall -9 sysdig
  killall -9 sysdig.sh
#  sleep 60
  fi
#  sleep 60
  killall -9 sysdig.sh
done

logrotate

for i in cat /proc/vz/veinfo | awk '{print $1}'|egrep -v '^0$'; do echo “Container $i”; vzctl exec $i “grep -i proxmox /etc/motd2 && awk ‘{if (/# rotate log files weekly/) { getline;print $1 };}’ /etc/logrotate.conf | grep weekly && sed ‘/# rotate log files weekly/{n;s/./monthly/}’ /etc/logrotate.conf > /etc/logrotate.tmp && mv -n /etc/logrotate.conf /etc/logrotate.conf.bak && mv -f /etc/logrotate.tmp /etc/logrotate.conf && sed ‘/rotate 4/{s/./rotate 12/}’ /etc/logrotate.conf > /etc/logrotate.tmp && mv -n /etc/logrotate.conf /etc/logrotate.conf.bak && mv -f /etc/logrotate.tmp /etc/logrotate.conf”; done