Code Monkey home page Code Monkey logo

qiniu-backup-linux's Introduction

QiNiu-Backup-Linux

使用七牛云存储命令行qshell工具备份Linux服务器数据脚本

说明

因需求定时备份数据库文件至QiNiu云存储找到官方工具qshell手动备份, 后因需要每天定时所以网上找了一段时间,最后在GitHub和某站找到脚本。 博主的脚本使用后会出现以下提示:

Removing leading `/' from member names 

故我对其压缩命令进行了修改,为日常使用放置于Github

依赖

配置

  1. 下载七牛qshell工具
  2. 配置 AccessKey 和 SecretKey
  3. 按照说明修改配置

使用

./qshell account AccessKey SecretKey

使用qiniu官方网站中 个人面板-->密钥管理-->创建密钥 来获得 AccessKey 和 SecretKey

修改 backup.sh 中参数为你自己的参数,都有说明。

手动备份

然后改为可执行文件:

chmod +x backup.sh #赋予权限

运行的时候就输入下面的代码即可:

./backup.sh

然后通过 cron 来设置定时运行脚本:

crontab -e
加入以下代码,:wq 保存
0 5 * * * /bin/bash /root/backup.sh

定时备份

crontab -e

加入以下代码,:wq 保存 填入以下,每天凌晨5点执行一次备份,这里可以根据需求进行调整

0 5 * * * /bin/bash /root/backup.sh

这里是配置成每月备份一次的设置

* * * 1 * /bin/bash /foo/backup.sh

参考

使用七牛云备份网站附件和数据库

qiniu-backup-linux's People

Contributors

meowcold avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.