玩客云刷armbian安装php环境_玩客云刷机为armbian后,挂载SD卡到www目录的脚本

编程知识 更新时间:2023-04-27 06:41:44

摘要:

这个脚本是我买了一个刷好armbian系统的玩客云,然后自己安装好了宝塔,最后发现磁...

这个脚本是我买了一个刷好armbian系统的玩客云,然后自己安装好了宝塔,最后发现磁盘根本不够用,才6G多,于是又买了一张SD卡,因为SD卡终身保固,而且不占地方。

后来参照宝塔官网自己写了一个脚本把SD卡挂载到WWW目录。

对于那些没有安装任何东西的小伙伴,大家可以执行下面的脚本:echo -e ""

echo -e "格式化SD卡..."

echo -e ""

sleep 2

mkfs.ext4 /dev/mmcblk0p1

echo -e ""

echo -e "挂载SD卡..."

echo -e ""

sleep 2

mount /dev/mmcblk0p1 /www

echo "/dev/mmcblk0p1    /www    ext4    defaults    0 0" >> /etc/fstab

echo -e ""

echo -e "处理完成"

echo -e ""

注意:/www为需要挂载的目录

对于安装了宝塔并且还有一点数据的朋友,可以使用下面的脚本:#!/bin/bash

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin

export PATH

LANG=en_US.UTF-8

stop_service(){

/etc/init.d/bt stop

if [ -f "/etc/init.d/nginx" ]; then

/etc/init.d/nginx stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/httpd" ]; then

/etc/init.d/httpd stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/mysqld" ]; then

/etc/init.d/mysqld stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/pure-ftpd" ]; then

/etc/init.d/pure-ftpd stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/tomcat" ]; then

/etc/init.d/tomcat stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/redis" ]; then

/etc/init.d/redis stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/memcached" ]; then

/etc/init.d/memcached stop > /dev/null 2>&1

fi

if [ -f "/www/server/panel/data/502Task.pl" ]; then

rm -f /www/server/panel/data/502Task.pl

if [ -f "/etc/init.d/php-fpm-52" ]; then

/etc/init.d/php-fpm-52 stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-53" ]; then

/etc/init.d/php-fpm-53 stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-54" ]; then

/etc/init.d/php-fpm-54 stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-55" ]; then

/etc/init.d/php-fpm-55 stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-56" ]; then

/etc/init.d/php-fpm-56 stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-70" ]; then

/etc/init.d/php-fpm-70 stop > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-71" ]; then

/etc/init.d/php-fpm-71 stop > /dev/null 2>&1

fi

fi

}

start_service()

{

/etc/init.d/bt start

if [ -f "/etc/init.d/nginx" ]; then

/etc/init.d/nginx start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/httpd" ]; then

/etc/init.d/httpd start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/mysqld" ]; then

/etc/init.d/mysqld start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/pure-ftpd" ]; then

/etc/init.d/pure-ftpd start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/tomcat" ]; then

/etc/init.d/tomcat start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/redis" ]; then

/etc/init.d/redis start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/memcached" ]; then

/etc/init.d/memcached start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-52" ]; then

/etc/init.d/php-fpm-52 start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-53" ]; then

/etc/init.d/php-fpm-53 start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-54" ]; then

/etc/init.d/php-fpm-54 start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-55" ]; then

/etc/init.d/php-fpm-55 start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-56" ]; then

/etc/init.d/php-fpm-56 start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-70" ]; then

/etc/init.d/php-fpm-70 start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-71" ]; then

/etc/init.d/php-fpm-71 start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-72" ]; then

/etc/init.d/php-fpm-71 start > /dev/null 2>&1

fi

if [ -f "/etc/init.d/php-fpm-73" ]; then

/etc/init.d/php-fpm-71 start > /dev/null 2>&1

fi

echo "True" > /www/server/panel/data/502Task.pl

}

echo -e ""

echo -e "停止宝塔服务"

echo -e ""

sleep 3

stop_service

echo -e ""

echo -e "数据备份..."

echo -e ""

sleep 2

mv /www /bt-backup

echo -e ""

echo -e "格式化SD卡..."

echo -e ""

sleep 2

mkfs.ext4 /dev/mmcblk0p1

echo -e ""

echo -e "挂载SD卡..."

echo -e ""

sleep 2

mkdir /www

mount /dev/mmcblk0p1 /www

echo "/dev/mmcblk0p1    /www    ext4    defaults    0 0" >> /etc/fstab

echo -e ""

echo -e "数据还原中..."

echo -e ""

cp -r -p -a /bt-backup/* /www

echo -e ""

echo -e "处理完成"

echo -e ""

echo -e "启动宝塔服务"

echo -e ""

start_service

rm -rf /bt-backup

注意:上面这个脚本使用的时候会自动备份宝塔数据,但是玩客云的剩余储存小于www目录的使用量时,就需要自己手动备份,清空一定量的空间,必须保证玩客云的剩余储存大于www目录的使用量。

这样看起来是不是空间大了好多了

更多推荐

玩客云刷armbian安装php环境_玩客云刷机为armbian后,挂载SD卡到www目录的脚本

本文发布于:2023-04-20 14:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/9dcee805676e6f013b7751b900c6e4c2.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   刷机   环境   目录   php

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 90283文章数
  • 23313阅读数
  • 0评论数