-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerformance
More file actions
36 lines (31 loc) · 974 Bytes
/
Performance
File metadata and controls
36 lines (31 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Performance.sh
#! /bin/bash
set -uox && set Errtrace
Declare Global:
Chronicles =
{ Chronilize = ( ps && watch -ac | less -nr 10 --format pid && %cpu)
Dailylog = 'Datime(time) %d ":" %d ":" %d ":" %d % (format %month %year %day %hours)'
}
Sched_Cron = { Crontab -e \n
* 9 * * 1
sudo {$Perform $Chronicles $Syslog}
}
If [ "$UID" -ne 0]:
Echo " must be root to execute this cript" || exit (0)
Fi:
Perform () {
For logging in ${Chronilize}: | less && tail -n 20 {print $1 ":" $2 ":" $3} > $Dailylog(logger.txt)
do Err declare: Echo " if there's an error from foreground command:"
exec > 2 & $Dailylog(Perform_error.txt)
done
return $Perform.Dailylog()
}
Sys_log() {
vars = './var/log/sys.log'
if [! -f "$var"] then;
Echo "the log is empty"
else do:
for -f in $vars
fm type -f {ctime, atime, mtime} | less | Xargs grep s'$vars' '*.log' ${print $[1:5] {} {} } > sys_log.txt
done
}