403Webshell
Server IP : 159.253.20.91  /  Your IP : 216.73.216.111
Web Server : nginx/1.20.2
System : Linux se38c9e53.fastvps-server.com 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17) x86_64
User : pr11_ru_usr ( 1041)
PHP Version : 8.1.29
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/atop/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/atop/atop.daily
#!/bin/sh

LOGOPTS=""				# default options
LOGINTERVAL=600				# default interval in seconds
LOGGENERATIONS=28			# default number of days
LOGPATH=/var/log/atop                   # default log location

# allow administrator to overrule the variables
# defined above
#
DEFAULTSFILE=/etc/default/atop		# possibility to overrule vars

if [ -e "$DEFAULTSFILE" ]
then
	. "$DEFAULTSFILE"

	# validate overruled variables
	# (LOGOPTS and LOGINTERVAL are implicitly by atop)
	#
 	case "$LOGGENERATIONS" in
	    ''|*[!0-9]*)
		echo non-numerical value for LOGGENERATIONS >&2
		exit 1;;
	esac
fi

CURDAY=`date +%Y%m%d`
BINPATH=/usr/bin
PIDFILE=/run/atop.pid

# verify if atop still runs for daily logging
#
if [ -e "$PIDFILE" ] && ps -p `cat "$PIDFILE"` | grep 'atop$' > /dev/null
then
	kill -USR2 `cat "$PIDFILE"`       # final sample and terminate

	CNT=0

	while ps -p `cat "$PIDFILE"` > /dev/null
	do
		CNT=$((CNT + 1))

		if [ $CNT -gt 5 ]
		then
			break;
		fi

		sleep 1
	done

	rm "$PIDFILE"
fi

# delete logfiles older than N days (configurable)
# start a child shell that activates another child shell in
# the background to avoid a zombie
#
( (sleep 3; find "$LOGPATH" -name 'atop_*' -mtime +"$LOGGENERATIONS" -exec rm {} \;)& )

# activate atop with an interval of S seconds (configurable),
# replacing the current shell
#
echo $$ > $PIDFILE
exec $BINPATH/atop $LOGOPTS -w "$LOGPATH"/atop_"$CURDAY" "$LOGINTERVAL" > "$LOGPATH/daily.log" 2>&1

Youez - 2016 - github.com/yon3zu
LinuXploit