Small fixes

This commit is contained in:
2022-02-15 14:44:35 +01:00
parent 653d233586
commit 1c99aee146
2 changed files with 6 additions and 4 deletions

View File

@@ -304,11 +304,11 @@ step_50() {
local buTarget="$2"
if [ -z $2 ] ; then
echoerr " [W] No target directory provided. Using home of current user"
buTarget="~/"
buTarget="~"
fi
echo " [I] Dumping database $dbName to $(realpath $buTarget)"
exep "mysqldump --single-transaction $dbName > \"${buTarget}/${dbName}_backup_\`date +%Y%m%d-%H%M%S\`.sql\""
exep "mysqldump --single-transaction $dbName > \"$(realpath $buTarget)/${dbName}_backup_$(date +%Y%m%d-%H%M%S).sql\""
endReturn -o $? "Error creating $dbName backup"
}

View File

@@ -3,7 +3,7 @@
serverName="nginx"
serverPackages="nginx"
serverSourceUrl="https://nginx.org/packages/debian/"
phpVersion="7.4"
phpVersion="7.3"
phpName="php${phpVersion}"
phpPackages="${phpName}-{fpm,gd,mysql,curl,xml,zip,intl,mbstring,bz2,ldap,apcu,bcmath,gmp,imagick,igbinary,redis,smbclient,cli,common,opcache,readline} imagemagick"
@@ -126,7 +126,9 @@ phpFpmIniLocation="/etc/php/${phpVersion}/fpm/php-fpm.conf"
step_5_info() { echo "Configuration of ${phpName} fpm and cli"; }
step_5() {
local AvailableRAM=$(awk '/MemAvailable/ {printf "%d", $2/1024}' /proc/meminfo)
local AverageFPM=$(ps --no-headers -o 'rss,cmd' -C php-fpm8.0 | awk '{ sum+=$1 } END { printf ("%d\n", sum/NR/1024,"M") }')
local AverageFPM=$(ps --no-headers -o 'rss,cmd' -C php-fpm$phpVersion | awk '{ sum+=$1 } END { printf ("%d\n", sum/NR/1024,"M") }')
echo $AvailableRAM
echo $AverageFPM
local FPMS=$((AvailableRAM/AverageFPM))
local PMaxSS=$((FPMS*2/3))
local PMinSS=$((PMaxSS/2))