原创内容,转载请注明出处:https://www.myzhenai.com.cn/post/1656.html https://www.myzhenai.com/thread-16096-1-1.html
使用前请先安装rar_Linux压缩工具,
Linux下rar压缩解压缩程序rar的安装使用方法:https://www.myzhenai.com/thread-15509-1-2.html https://www.myzhenai.com.cn/post/1040.html
将以下脚本内容修改自己的配置后保存为后缀名为.sh的文件即可.运行的时候请用 sh ****.sh
# Linux CentOS Server Shell Tools # Script author: https://www.myzhenai.com/ https://www.myzhenai.com.cn/ https://www.haikou-china.com/ https://jiayu.mybabya.com/ # !/bin/bash # Clear System Cache projects may not need these codes rm -rf /usr/local/lxlabs/kloxo/serverfile/tmp/* rm -rf /tmp/* rm -f /home/admin/__processed_stats/* rm -rf /home/kloxo/httpd/lighttpd/* rm -rf /var/log/kloxo/* rm -f /home/httpd/*/stats/*log # Mysql database optimization options mysqlcheck -Ao -uroot -pPassword # Backup mysql database options send=`date '+%Y-%m-%d'` mysqldump -uroot -pPassword MysqlName | gzip > /var/wwwroot/www/FileName.$send.sql.gz # MysqlName is the database name Password is Database Password /var/wwwroot/www/ Please replace the root directory of your website. # Site data backup options rar a FileName.zip -r /var/wwwroot/www/* -pPassword # Password is Compression password document /var/wwwroot/www/ is Your site's root directory mv FileName.zip /var/wwwroot/www/FileName.zip # Optimize system memory options echo 3 > /proc/sys/vm/drop_caches echo 0 > /proc/sys/vm/drop_caches echo 1 > /proc/sys/vm/drop_caches swapoff -a swapon -a yum clean all # Restart option related components service mysqld restart service lighttpd restart service httpd restart echo '*********************************************************'; echo '**** The script is finished ****'; echo '**** ming ling yi jing zhi xing wan cheng . ****'; echo '**** https://www.myzhenai.com.cn ****'; echo '*********************************************************';
sicnature ---------------------------------------------------------------------
I P 地 址: 3.133.153.134
区 域 位 置: 美国
系 统 信 息:
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普 | 海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source https://myzhenai.com.cn/post/1656.html
1 评论
使用前请自行修改脚本,主要是修改你的网站目录地址以及数据库密码等.切记