远程备份备份不了

问答中心分类: Linux远程备份备份不了
兰亭楼 asked 4年 ago

测试了一下 腾讯的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
兰亭楼 answered 4年 ago
远程备份  指的是  2. Remote host 选项

oneinstack answered 4年 ago
./backup_setup.sh 设置是否正常?

兰亭楼 answered 4年 ago
设置正常, 显示ssh_ok

兰亭楼 answered 4年 ago
两台linux机器都试过了, 配置的时候 显示 ssh_ok 在tools文件夹下面也能看到iplist.txt的保存着远程服务器账号和密码,但是只是 backup.sh 就是远程没有文件,很奇怪

oneinstack answered 4年 ago
bash -x ./backup.sh 过程记录下!

兰亭楼 answered 4年 ago
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 ']'

兰亭楼 answered 4年 ago
好像找到原因了 是不是不能用域名 只能用IP?

oneinstack answered 4年 ago
./mabs.sh -c config_bakcup.txt -T -1 这个执行好像无效,换IP试试

兰亭楼 answered 4年 ago
我试过了 用ip地址就行 用域名就不行,不知道是什么原因,不支持域名吗?

oneinstack answered 4年 ago
只支持IP,mabs.sh中做了过滤!