Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

ubuntu delete php session (inodes full 100%)

find /var/lib/php/sessions -type f -cmin +24 -name "sess_*" -exec rm -f {} ;
Comment

ubuntu delete php session (inodes full 100%)

#!/bin/bash 
 
# Export bin paths
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
# Get PHP Session Details
PHPSESSIONPATH=$(php -i 2>/dev/null | grep -w session.save_path | awk '{print $3}' | head -1);
PHPSESSIONLIFETIME=$(php -i 2>/dev/null | grep -w session.gc_maxlifetime | awk '{print $3}' | head -1);
PHPSESSIONLIFETIMEMINUTE=$( expr $PHPSESSIONLIFETIME / 60 );
 
# If PHPSESSIONPATH exists
if [ -d $PHPSESSIONPATH ];
then
    # Find and delete "expired" sessions
    find $PHPSESSIONPATH -type f -cmin +$PHPSESSIONLIFETIMEMINUTE -name "sess_*" -exec rm -f {} ;
fi
Comment

ubuntu delete php session (inodes full 100%)

# Delete PHP sessions
0 * * * *   root    /root/clean-php-session-files.sh >/dev/null 2>&1
Comment

PREVIOUS NEXT
Code Example
Shell :: reuse an old git branch name after merge 
Shell :: install sanity with free boosted plan - sanity.io -sonny 
Shell :: how to merge two repositories in github 
Shell :: get unix time from date 
Shell :: git stash pop specific 
Shell :: speed up ubuntu 
Shell :: how to clone repo with all branches 
Shell :: search in github repo 
Shell :: install docker debian 10 
Shell :: touch command not recognized in windows 
Shell :: git how to learn 
Shell :: grep search match in all files in folder 
Shell :: apt-get install plex 
Shell :: Unit Tests 
Shell :: how to assign a value to a variable in batch script using powershell 
Shell :: linux delete file content 
Shell :: sed match newline 
Shell :: add one drive to ubuntu 
Shell :: echo exit code 
Shell :: corewar 42 github 
Shell :: heroku pg:pull ----exclude-table-dat 
Shell :: predate.sh linux error logging 
Shell :: apt mailbox debian 10 
Php :: info.php 
Php :: php replace spaces with dash 
Php :: timestamp false in laravel 
Php :: php only my ip 
Php :: laravel 8 password confirmation validation 
Php :: laravel validation number greater than 0 
Php :: get page title wordpress 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =