linux定时删除session存储文件

1,建立shell脚本

#cleansession.sh
#!/bin/sh
find “session存储目录” -type f |xargs rm -rf “*”
2,建立计划任务,每天凌晨4点执行计划任务,删除session存储文件

[root@bogon script]# crontab -e
00 04 * * * root /opt/script/cleansession.sh

猜你喜欢

转载自blog.csdn.net/xfcy1990/article/details/89010763