测试了一下 腾讯的COS正常。
但是远程备份本地备份成功有文件,但是远程的服务器上并没有文件。
db.log
[/data/backup/DB_wx2_20180717*.tgz] Delete Old Backup File
[/data/backup/DB_wx2_20180718_02.tgz] Backup success
mabs.log
2018-07-18 02:42:38 — 2018-07-18 02:42:41
./mabs.sh –excutes over!
oneinstack是最新版的
10 Answers
两台linux机器都试过了, 配置的时候 显示 ssh_ok 在tools文件夹下面也能看到iplist.txt的保存着远程服务器账号和密码,但是只是 backup.sh 就是远程没有文件,很奇怪
bash -x ./backup.sh
++ id -u
+ '[' 0 '!=' 0 ']'
+++ readlink -f ./backup.sh
++ dirname /root/oneinstack/backup.sh
+ oneinstack_dir=/root/oneinstack
+ pushd /root/oneinstack/tools
+ . ../options.conf
++ run_user=www
++ nginx_install_dir=/usr/local/nginx
++ tengine_install_dir=/usr/local/tengine
++ openresty_install_dir=/usr/local/openresty
++ apache_install_dir=/usr/local/apache
++ tomcat_install_dir=/usr/local/tomcat
++ mysql_install_dir=/usr/local/mysql
++ mariadb_install_dir=/usr/local/mariadb
++ percona_install_dir=/usr/local/percona
++ alisql_install_dir=/usr/local/alisql
++ pgsql_install_dir=/usr/local/pgsql
++ mongo_install_dir=/usr/local/mongodb
++ php_install_dir=/usr/local/php
++ pureftpd_install_dir=/usr/local/pureftpd
++ memcached_install_dir=/usr/local/memcached
++ redis_install_dir=/usr/local/redis
++ python_install_dir=/usr/local/python
++ openssl_install_dir=/usr/local/openssl
++ imagick_install_dir=/usr/local/imagemagick
++ gmagick_install_dir=/usr/local/graphicsmagick
++ curl_install_dir=/usr/local/curl
++ nginx_modules_options=
++ php_modules_options=
++ mysql_data_dir=/data/mysql
++ mariadb_data_dir=/data/mariadb
++ percona_data_dir=/data/percona
++ alisql_data_dir=/data/alisql
++ pgsql_data_dir=/data/pgsql
++ mongo_data_dir=/data/mongodb
++ wwwroot_dir=/data/wwwroot
++ wwwlogs_dir=/data/wwwlogs
++ dbrootpwd=123456
++ dbpostgrespwd=
++ dbmongopwd=
++ backup_dir=/root
++ expired_days=1
++ backup_destination=remote
++ backup_content=db
++ oss_bucket=
++ qiniu_bucket=
++ db_name=we
++ website_name=wx.xxxxxx.com
++ oneinstack_md5=9e95f867a5b1cec9d1cfe7abbb177be6
+ '[' '!' -e /root ']'
++ echo remote
++ tr , ' '
+ for DEST in '`echo ${backup_destination} | tr '\'','\'' '\'' '\''`'
+ '[' remote == local ']'
+ '[' remote == remote ']'
+ echo 'com:::[ ! -e /root ] && mkdir -p /root'
++ echo db
++ grep -ow db
+ '[' -n db ']'
+ DB_Remote_BK
++ echo we
++ tr , ' '
+ for D in '`echo ${db_name} | tr '\'','\'' '\'' '\''`'
+ ./db_bk.sh we
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
~ ~/oneinstack/tools
++ date +%Y%m%d
+ DB_GREP=DB_we_20180719
++ ls -lrt /root
++ grep DB_we_20180719
++ tail -1
++ awk '{print $NF}'
+ DB_FILE=DB_we_20180719_10.tgz
+ echo 'file:::/root/DB_we_20180719_10.tgz /root push'
++ date +%Y%m%d '--date=1 days ago'
+ echo 'com:::[ -e /root/DB_we_20180719_10.tgz ] && rm -rf /root/DB_we_20180718_*.tgz'
++ echo db
++ grep -ow web
+ '[' -n '' ']'
+ tee mabs.log
+ ./mabs.sh -c config_bakcup.txt -T -1
2018-07-19 10:36:13 -- 2018-07-19 10:36:16
./mabs.sh --excutes over!
+ '[' remote == oss ']'
+ '[' remote == cos ']'
+ '[' remote == upyun ']'
+ '[' remote == qiniu ']'
++ id -u
+ '[' 0 '!=' 0 ']'
+++ readlink -f ./backup.sh
++ dirname /root/oneinstack/backup.sh
+ oneinstack_dir=/root/oneinstack
+ pushd /root/oneinstack/tools
+ . ../options.conf
++ run_user=www
++ nginx_install_dir=/usr/local/nginx
++ tengine_install_dir=/usr/local/tengine
++ openresty_install_dir=/usr/local/openresty
++ apache_install_dir=/usr/local/apache
++ tomcat_install_dir=/usr/local/tomcat
++ mysql_install_dir=/usr/local/mysql
++ mariadb_install_dir=/usr/local/mariadb
++ percona_install_dir=/usr/local/percona
++ alisql_install_dir=/usr/local/alisql
++ pgsql_install_dir=/usr/local/pgsql
++ mongo_install_dir=/usr/local/mongodb
++ php_install_dir=/usr/local/php
++ pureftpd_install_dir=/usr/local/pureftpd
++ memcached_install_dir=/usr/local/memcached
++ redis_install_dir=/usr/local/redis
++ python_install_dir=/usr/local/python
++ openssl_install_dir=/usr/local/openssl
++ imagick_install_dir=/usr/local/imagemagick
++ gmagick_install_dir=/usr/local/graphicsmagick
++ curl_install_dir=/usr/local/curl
++ nginx_modules_options=
++ php_modules_options=
++ mysql_data_dir=/data/mysql
++ mariadb_data_dir=/data/mariadb
++ percona_data_dir=/data/percona
++ alisql_data_dir=/data/alisql
++ pgsql_data_dir=/data/pgsql
++ mongo_data_dir=/data/mongodb
++ wwwroot_dir=/data/wwwroot
++ wwwlogs_dir=/data/wwwlogs
++ dbrootpwd=123456
++ dbpostgrespwd=
++ dbmongopwd=
++ backup_dir=/root
++ expired_days=1
++ backup_destination=remote
++ backup_content=db
++ oss_bucket=
++ qiniu_bucket=
++ db_name=we
++ website_name=wx.xxxxxx.com
++ oneinstack_md5=9e95f867a5b1cec9d1cfe7abbb177be6
+ '[' '!' -e /root ']'
++ echo remote
++ tr , ' '
+ for DEST in '`echo ${backup_destination} | tr '\'','\'' '\'' '\''`'
+ '[' remote == local ']'
+ '[' remote == remote ']'
+ echo 'com:::[ ! -e /root ] && mkdir -p /root'
++ echo db
++ grep -ow db
+ '[' -n db ']'
+ DB_Remote_BK
++ echo we
++ tr , ' '
+ for D in '`echo ${db_name} | tr '\'','\'' '\'' '\''`'
+ ./db_bk.sh we
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
~ ~/oneinstack/tools
++ date +%Y%m%d
+ DB_GREP=DB_we_20180719
++ ls -lrt /root
++ grep DB_we_20180719
++ tail -1
++ awk '{print $NF}'
+ DB_FILE=DB_we_20180719_10.tgz
+ echo 'file:::/root/DB_we_20180719_10.tgz /root push'
++ date +%Y%m%d '--date=1 days ago'
+ echo 'com:::[ -e /root/DB_we_20180719_10.tgz ] && rm -rf /root/DB_we_20180718_*.tgz'
++ echo db
++ grep -ow web
+ '[' -n '' ']'
+ tee mabs.log
+ ./mabs.sh -c config_bakcup.txt -T -1
2018-07-19 10:36:13 -- 2018-07-19 10:36:16
./mabs.sh --excutes over!
+ '[' remote == oss ']'
+ '[' remote == cos ']'
+ '[' remote == upyun ']'
+ '[' remote == qiniu ']'
Please login or Register to submit your answer