75 lines
1.8 KiB
Plaintext
75 lines
1.8 KiB
Plaintext
################################################################################
|
|
# Systemd and journald aliases
|
|
|
|
# TODO : add color in help-journald
|
|
# TODO : update README with new aliases
|
|
|
|
echo -e "\nEnter 'help-journald' to print internal aliases and functions for systemd/journald"
|
|
|
|
alias help-journald='echo "
|
|
Log level:
|
|
0 - emerg
|
|
1 - alert
|
|
2 - crit
|
|
3 - err
|
|
4 - warning
|
|
5 - notice
|
|
6 - info
|
|
7 - debug
|
|
|
|
Journald from boot - default level : jb
|
|
Journald from boot - level crit : jbc
|
|
Journald from boot - level err : jbe
|
|
Journald from boot - level warning : jbw
|
|
|
|
Journald follow - default level : jf
|
|
Journald follow - level crit : jfc
|
|
Journald follow - level err : jfe
|
|
Journald follow - level warning : jfw
|
|
|
|
Journald follow one or more units : jfu <unit1> <unit2> ...
|
|
|
|
List units in failed state : scf
|
|
|
|
Status of unit(s) : scs <unit1> <unit2> ...
|
|
|
|
Cat systemd unit file : scc <unit1> <unit2> ...
|
|
"'
|
|
################################################################################
|
|
|
|
# Journald from boot
|
|
# - default
|
|
alias jb="journalctl --boot"
|
|
# crit
|
|
alias jbc="journalctl --boot --priority=crit"
|
|
# err
|
|
alias jbe="journalctl --boot --priority=err"
|
|
# warning
|
|
alias jbw="journalctl --boot --priority=warning"
|
|
|
|
# Journald follow
|
|
# - default
|
|
alias jf="journalctl --follow"
|
|
# crit
|
|
alias jfc="journalctl --follow --priority=crit"
|
|
# err
|
|
alias jfe="journalctl --follow --priority=err"
|
|
# warning
|
|
alias jfw="journalctl --follow --priority=warning"
|
|
|
|
# Journald follow one or more units
|
|
function jfu(){
|
|
for UNIT in $@; do
|
|
UNITS+=" -u $UNIT"
|
|
done
|
|
journalctl -f $UNITS;
|
|
}
|
|
|
|
# List units in failed state
|
|
alias scf="systemctl list-units --failed"
|
|
# Status of unit(s)
|
|
function scs(){ systemctl status $@; }
|
|
# Cat systemd unit file
|
|
function scc(){ systemctl cat $@; }
|
|
|