1. <i id='wiidi'><div id='wiidi'><ins id='wiidi'></ins></div></i>
      <ins id='wiidi'></ins>
        1. <dl id='wiidi'></dl>

          <i id='wiidi'></i>

          <code id='wiidi'><strong id='wiidi'></strong></code>
          <span id='wiidi'></span>

          1. <tr id='wiidi'><strong id='wiidi'></strong><small id='wiidi'></small><button id='wiidi'></button><li id='wiidi'><noscript id='wiidi'><big id='wiidi'></big><dt id='wiidi'></dt></noscript></li></tr><ol id='wiidi'><table id='wiidi'><blockquote id='wiidi'><tbody id='wiidi'></tbody></blockquote></table></ol><u id='wiidi'></u><kbd id='wiidi'><kbd id='wiidi'></kbd></kbd>
          2. <acronym id='wiidi'><em id='wiidi'></em><td id='wiidi'><div id='wiidi'></div></td></acronym><address id='wiidi'><big id='wiidi'><big id='wiidi'></big><legend id='wiidi'></legend></big></address><fieldset id='wiidi'></fieldset>

            CentOS系统备份脚本详解

            • 时间:
            • 浏览:6
            • 来源:124软件资讯网

                #!/bin/sh

                #设定变量

                bak_path=/root/bak_linux

                date=$(date +%Y%m%d)

                log_file=$bak_path/$date#log.log

                #把执行效果写到日志中

                exec 1>>$log_file 2>&1

                #把要备份的目录打包放到$bak_path目录下

                tar -zcvf $bak_path/$date#boot.tar.gz /boot

                tar -zcvf $bak_path/$date#etc.tar.gz /etc

                tar -zcvf $bak_path/$date#var.tar.gz /var

                echo "############\n"

                echo $?

                #上传备份文件

                ftp -i -n -v << FTPIT

                open 192.168.0.27

                user 111 111

                binary

                lcd $bak_path

                mput *.tar.gz

                put *#log.log

                by

                FTPIT

                echo "############\n"

                echo $?

                #删除上传完毕的.tar和.log文件

                rm -rf $bak_path/*#*.tar

                rm -rf $bak_path/*#log.log