Pocesses and task scheduling Flashcards
customize ps columns
ps -o comm,pid,ppid,user
show processes for a specific command
ps -C sshd
find pid of a specific process
pidof rsyslogd
pgrep rsyslogd
list processes by user or group
ps -u user1
ps -G root
explain niceness
the priority given to a process, -20 = highest priority, 19 = lowest priority, default is 0
list process with niceness column
ps -efl = lower case L
NI column is niceness
run a program with different niceness value
nice -n -10 top
or
nice -n 2 top
alter process priority will process running
sudo renice -n -5 $(pidof top)
list kill signals
kill -l
default kill signal number
15 - soft kill - terminate in an orderly fashion
kill crond with kill and pkill
sudo pkill crond
sudo kill $(pidof crond)
pkill uses the name as kill need PID
kill all crond processes
killall crond
force kill crond
kill -9 $(pidof crond)
pkill -9 crond
where are submitted at jobs stored
var/spool/at
submit an at job
at 11:30pm 3/31/22
at>date &> /tmp/date.out
at>press ctrl d
list at jobs
atq
where are system crontables stored
/etc/crontab
/etc/cron.d
where are submitted cron jobs stored for user1
/var/spool/cron/user1
crontable syntax
Field1 - minute of hour
Field2 - hour of day
Field3 - Day of month
Field4 - Month of year
Field5 - day of week
Field6 - Command or program to execute
*/5 10-11 5,20 * * echo “Hello” > /tmp/hello.out
https://www.adminschoice.com/crontab-quick-reference
https://crontab.guru/
Where do the scheduling daemons store log information of executed jobs?
The scheduling daemons store log information of executed jobs in the
/var/log/cron file.