Affichage des articles dont le libellé est log. Afficher tous les articles
Affichage des articles dont le libellé est log. Afficher tous les articles

mardi 9 novembre 2021

Linux cleaning tips (systemd, apt/ubuntu, docker)

 (evolutive article where I store what's been useful to me to clean space on linux servers I'm using)

Note : my current servers are running Ubuntu.



OS / SystemD : purge logs bigger than ...

Only keep 10M of each log files handle through syslog

sudo journalctl --vacuum-size 10M


OS / apt : remove remnants

Remove automatically all unused packages Remove automatically installed packages not needed anymore (i.e. packages that were installed as dependencies of packages that have now been removed or aren't requiring this dependency anymore)

apt options :

  •   autoremove - Remove automatically all unused packages
  •   clean - Erase downloaded archive files
  •   autoclean - Erase old downloaded archive files

sudo apt-get clean autoremove autoclean



Docker : remove logs older than ...

Only keep the last 1000h of docker containers logs

sudo docker image prune --all --filter "until=1000h" -f


Docker : remove remnants

Be careful ! If your docker environments are not running they might be deleted by some of the following commands !

Remove unused volumes, containers, images, networks, etc.

sudo docker system prune -f 

sudo docker system prune -a --volumes


vendredi 7 juin 2019

JIRA Script Runner log debug

snippet of code to use the output logs in ScriptRunner Adaptavist groovy scripts  

ScriptRunner log.debug

tool

ScriptRunner for JIRA

version

8.1.1

use case
log.debug SR script


/***********/
import org.apache.log4j.Logger
import org.apache.log4j.Level
 
def log = Logger.getLogger("com.scriptname")
log.setLevel(Level.DEBUG)
/***********/
 
//and then, for example to print the variable trem
log.debug "trem=${trem}"


example :