#!/bin/bash
session_dir="/var/cpanel/php/sessions"
touch --date "$(date -d '30 days ago' +'%Y-%m-%d %H:%M:%S')" $session_dir/older_than_this
find $session_dir -type f -not -newer $session_dir/older_than_this -delete
#!/bin/bash
session_dir="/var/cpanel/php/sessions"
touch --date "$(date -d '30 days ago' +'%Y-%m-%d %H:%M:%S')" $session_dir/older_than_this
find $session_dir -type f -not -newer $session_dir/older_than_this -delete