Centos利用qshell自动备份程序上传到七牛云
安装qshell cd /root wget http://devtools.qiniu.com/qshell-v2.1.8.zip unzip qshell-v.2.1.8.zip mkdir tool mv qshell_linux_x64 ./tool/qshell 2.添加全局访问 vim ~/.bashrc 插入 export PATH=$PATH:/root/tool 3. 编写压缩备份脚本 vim folderback.sh #!/bin/sh BACK_DIR="/home/repository/programbackup/" #压缩目录 BACK_TARGET="/home/repository/nongwanyun/" #目标目录 DATE=`date +%F` zip -rP 密码 $BACK_DIR"nongwanyun_back_"$DATE.zip $BACK_TARGET chmod +x folderback.sh 4. 编写七牛云配置文件 cd /root/tool/ mkdir conf cd conf touch qshell.conf vim qshell.conf #输入 { "src_dir" : "/home/repository/programbackup", #要备份的目录 "bucket" : "backup", "key_prefix" : "nongwanyun/", "access_key" : "七牛ak", "secret_key" : "七牛sk", "up_host" : "", "ignore_dir" : false, "overwrite" : false, "check_exists" : false, "check_hash" : false, "check_size" : false, "rescan_local" : true, "skip_file_prefixes" : "test,demo,", "skip_path_prefixes" : "hello/,temp/", "skip_fixed_strings" : ".svn,.git", "skip_suffixes" : ".DS_Store,.exe", "log_file" : "upload.log", "log_level" : "info", "log_rotate" : 1, "log_stdout" : false } 5.编写qshell上传脚本 cd /root touch folderupload.sh vim folderupload.sh #插入 #!/bin/sh … Read more