Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Magento delete session files
#!/bin/sh
# Place this script in magento/var/ directory
for n in `seq 0 9`
do
for u in `seq 0 9`
do
for m in `seq 0 9`
do
name="sess_"$n$u$m*
echo $name
find session/ -name $name -type f -mtime +7 -delete
echo $name ok
done
for m in {a..z}
do
name="sess_"$n$u$m*
echo $name
find session/ -name $name -type f -mtime +7 -delete
echo $name ok
done
done
for u in {a..z}
do
for m in `seq 0 9`
do
name="sess_"$n$u$m*
echo $name
find session/ -name $name -type f -mtime +7 -delete
echo $name ok
done
for m in {a..z}
do
name="sess_"$n$u$m*
echo $name
find session/ -name $name -type f -mtime +7 -delete
echo $name ok
done
done
done
for n in {a..z}
do
for u in `seq 0 9`
do
for m in `seq 0 9`
do
name="sess_"$n$u$m*
echo $name
find session/ -name $name -type f -mtime +7 -delete
echo $name ok
done
for m in {a..z}
do
name="sess_"$n$u$m*
echo $name
find session/ -name $name -type f -mtime +7 -delete
echo $name ok
done
done
for u in {a..z}
do
for m in `seq 0 9`
do
name="sess_"$n$u$m*
echo $name
find session/ -name $name -type f -mtime +7 -delete
echo $name ok
done
for m in {a..z}
do
name="sess_"$n$u$m*
echo $name
find session/ -name $name -type f -mtime +7 -delete
echo $name ok
done
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.