• <tr id='kygpv'><strong id='kygpv'></strong><small id='kygpv'></small><button id='kygpv'></button><li id='kygpv'><noscript id='kygpv'><big id='kygpv'></big><dt id='kygpv'></dt></noscript></li></tr><ol id='kygpv'><table id='kygpv'><blockquote id='kygpv'><tbody id='kygpv'></tbody></blockquote></table></ol><u id='kygpv'></u><kbd id='kygpv'><kbd id='kygpv'></kbd></kbd>
    <i id='kygpv'><div id='kygpv'><ins id='kygpv'></ins></div></i>

      <fieldset id='kygpv'></fieldset>

      <acronym id='kygpv'><em id='kygpv'></em><td id='kygpv'><div id='kygpv'></div></td></acronym><address id='kygpv'><big id='kygpv'><big id='kygpv'></big><legend id='kygpv'></legend></big></address>
      <span id='kygpv'></span>

      <code id='kygpv'><strong id='kygpv'></strong></code>
        <dl id='kygpv'></dl>
        <ins id='kygpv'></ins>
          <i id='kygpv'></i>

            CentOS系统备份脚本详解

            • 时间:
            • 浏览:14
            • 来源: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