Google Driveに諸々バックアップするんやで

#!/bin/bash

BASEDIR=/root/backup

function execmd () {
    echo "$ $1" >> $BASEDIR/backup.log
    $1 >> $BASEDIR/backup.log
    echo >> $BASEDIR/backup.log
}

echo "[Backup log]" >> $BASEDIR/backup.log
echo >> $BASEDIR/backup.log

execmd "mkdir -p $BASEDIR/backup"
execmd "sh $BASEDIR/backup_mysql.sh"
execmd "tar -zcvf $BASEDIR/backup/home.tar.gz -C / home"
execmd "tar -zcvf $BASEDIR/backup/var_www_git.tar.gz -C / var/www/git"
execmd "tar -zcvf $BASEDIR/backup/var_www_html.tar.gz -C / var/www/html"
execmd "tar -zcvf $BASEDIR/backup/etc_httpd.tar.gz -C / etc/httpd"
execmd "tar -zcvf $BASEDIR/backup/usr_share_phpMyAdmin.tar.gz -C / usr/share/phpMyAdmin"
execmd "cp -p /etc/bashrc $BASEDIR/backup/etc_bashrc"
execmd "cp -p /etc/vimrc $BASEDIR/backup/etc_vimrc"
execmd "cp -p  $BASEDIR/backup.sh $BASEDIR/backup/root_backup_backup_backup.sh"
execmd "cp -p  $BASEDIR/backup_mysql.sh $BASEDIR/backup/root_backup_backup_backup_mysql.sh"

execmd "tar -zcvf $BASEDIR/backup.tar.gz -C / root/backup/backup"
execmd "rm -rv --interactive=never $BASEDIR/backup"
execmd "mv $BASEDIR/backup.tar.gz $BASEDIR/backup-`date '+%Y%m%d'`.tar.gz"
/usr/local/bin/gdrive upload -p [Dir ID] $BASEDIR/backup-*.tar.gz
execmd "rm -rv --interactive=never $BASEDIR/backup-*.tar.gz"

# log
cat $BASEDIR/backup.log | mail -s "Backup of www.test.com" hoge@gmail.com
mv $BASEDIR/backup.log $BASEDIR/backup-`date '+%Y%m%d'`.log
/usr/local/bin/gdrive upload -p 1lXDeJIxxiz8F7QQGF-quF07h3CKbKpXW $BASEDIR/backup-*.log
rm --interactive=never $BASEDIR/backup-*.log

CentOS7のネットワーク設定

$ nmcli device # デバイスの確認 
デバイス  タイプ    状態      接続
eth0      eth0      接続済み  eth0
lo        loopback  管理無し  --

$ nmcli connection modify enp0s3 ipv4.addresses "192.168.0.123/24" #IP固定
$ nmcli c modify eth0 ipv4.gateway 192.168.0.1 # デフォルトゲートウェイ設定
$ nmcli connection modify eth0 ipv4.dns "8.8.8.8 8.8.4.4" # DNS設定
$ nmcli c down eth0; nmcli c up eth0 # インターフェースを再起動し設定反映 
$ systemctl restart network.service # ネットワークを再起動
$ nmcli d show eth0 # 設定を確認