Coder Social home page Coder Social logo

backup's Introduction

用来做备份的一个工具,目前支持localfile备份 ssh远程备份 pgsql的备份,并能打包成一个压缩文件,提供HTTP下载

只需要一个配置文件就可以在本地,远程,或者将pqgsql 的数据全量备份下来,非常的方便,可以当成CMD单次备份使用,也可以当成一个服务进行定时备使用,后面将支持MYSQL等数据的备份。

设置配置文件

        #备份的文件夹
        backupdir=D:/backup
        #是否以服务方式启动,1 为以服务启动,0为以CMD运行
        service = 1
        #service = 1 才起效 m:分钟 s:秒
        sleeptime = 5/m
        #保存多少天,超过时间的删除
        savedays = 2


        ###备份本地文件
        [local]
        mode = file
        dir = D:/work/test/edge/edgelog

        ###备份SSH远程文件
        [edgelog]
        mode = ssh
        host = 127.0.0.1
        port = 22
        user = test
        passwd = test
        dir = /var/log/data

        ##备份Pgsql文件
        [pgsql]
        mode = pgsql
        dsn="host=127.0.0.1 user=postgres password=123456 dbname=test port=30388  sslmode=disable TimeZone=Asia/Shanghai"
        schema=hvac

#启动效果

DownLoading D:/work/test/edge-services/edgelog [##################################################] 100% 63/63 Done!
:: Begin Execute Task 【local2】::
DownLoading D:/work/test/edge-services/edgexport [##################################################] 100% 76/76 Done!
:: Begin Execute Task 【edgelog】::
DownLoad /edge-services/edgelog/data:[##################################################] 100% 1/1 Done!
:: Begin Compress BackupDataDict 【D:/backup/tmp000696D3ACD7BA78】::
################## Compress Backup Data Is Success! ################

##并可以提供http下载,访问,http://{ip}:17894,列表显示打包文件,并可以进行下载。

-rw-rw-rw-   [email protected]  10843377 byte  2021-10-25 10:16:08.4752685 +0800 CST
-rw-rw-rw-   [email protected]  10843360 byte  2021-10-25 10:05:40.2144843 +0800 CST
-rw-rw-rw-   [email protected]  10843416 byte  2021-10-25 10:10:54.1849612 +0800 CST

backup's People

Contributors

xuejiazhi avatar

Stargazers

 avatar

Watchers

 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.