GithubHelp home page GithubHelp logo

huobazi / dackup Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 4.0 4.48 MB

Dackup is a free, open source, backup client for your files and database to Cloud

Home Page: http://huobazi.github.com/dackup/

License: MIT License

C# 95.77% Shell 1.96% Dockerfile 2.27%
backup dotnet-core backup-utility dotnetcore backup-tool backup-solution backup-script backup-manager backup-database backup-cli backup-scripts

dackup's Introduction

Dackup

Dackup is a fullstack backup tool was written by .NET Core, that is fast, efficient and secure. It supports the three major operating systems (Linux, macOS, Windows)

dackup

Features

  • Cross-Platform (win/osx/linux).
  • Docker Container support
  • No Dependence.
  • Archive folder or files to tar.gz
  • Multiple Databases source support.
  • Multiple Storage type support.
  • Multiple Notifier type support.

Databases

Archive

Archive files or folder into a .tar.gz file.

Storages

Notifiers

Usage

Help

$ /your_path/dackup

A backup app for your server or database or desktop

Usage: dackup [options] [command]

Options:
  -?|-h|--help  Show help information

Commands:
  new           Generate a config file
  perform       Performing your backup by config

Run 'dackup [command] --help' for more information about a command.

Use arrow keys to scroll. Press 'q' to exit.

Generate config

$ /your_path/dackup new

Generate a config file

Usage: dackup new [arguments] [options]

Arguments:
  model         Name of the model

Options:
  -?|-h|--help  Show help information

Use arrow keys to scroll. Press 'q' to exit.

Perform

$ /your_path/dackup perform

Usage: dackup perform [options]

Options:
  --config-file <FILE>  Required. The File name of the config.
  --log-path <PATH>     op. The File path of the log.
  --tmp-path <PATH>     op. The tmp path.
  -?|-h|--help          Show help information

Use arrow keys to scroll. Press 'q' to exit.

Configuration

Use the subcommand new to generate a task config file, such as mockup config file

$ /your_path/dackup new my_first_task

Docker

Compiled Docker image can be pulled from: Docker Hub.

$ docker pull huobazi/dackup:latest
$ docker run --name dackup --net=host -v /config/dackup.config:/config/dackup.config huobazi/dackup perform --config-file /config/dackup.config

Crontab

$ crontab -l
0 1 * * * /your_path/dackup perform --config-file /your_path/your_first_task.config --tmp-path /your_tmp_path/first --log-path /your_log_path
0 2 * * * /your_path/dackup perform --config-file /your_path/your_second_task.config --tmp-path /your_tmp_path/second --log-path /your_log_path
0 3 * * * docker run --name dackup --net=host -v /config/dackup.config:/config/dackup.config huobazi/dackup perform --config-file /config/dackup.config

Install

You can download binary from releases page and place it in $PATH directory.

Or pull it from Docker Hub

Build

Install dotnet core sdk 3.1 then run

./release.sh

see also: Release Script

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Contributors

Contributors List.

License

MIT

dackup's People

Contributors

bvisonl avatar huobazi avatar totpero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dackup's Issues

No such file or directory

I'm experiencing the following error when trying to perform a test backup:

2021-05-14 18:51:44.882 +00:00 [INF] Dackup start backup task
2021-05-14 18:51:44.921 +00:00 [INF] Dackup start [PostgresBackupTask.BackupAsync]
2021-05-14 18:51:44.927 +00:00 [INF] Testing connection to Postgres 'XXXX@ZZZZZ:5432/TTTT'...
2021-05-14 18:51:45.416 +00:00 [INF] Connection to to Postgres 'XXXX@ZZZZZ:5432/TTTT' established.
2021-05-14 18:51:45.418 +00:00 [INF] Checking pg_dump existence...
2021-05-14 18:51:45.425 +00:00 [ERR] *** Crash! ***
System.AggregateException: One or more errors occurred. (No such file or directory)
 ---> System.ComponentModel.Win32Exception (2): No such file or directory
   at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Dackup.Backup.PostgresBackupTask.CheckDbBackupCommand()
   at Dackup.Backup.DatabaseBackupTask.Backup()
   at Dackup.Backup.BackupTaskBase.<BackupAsync>b__2_0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
   at Dackup.Backup.BackupTaskBase.BackupAsync()
   at Dackup.DackupApplication.Run(String configFilePath)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Dackup.Program.<>c__DisplayClass0_2.<Main>b__5()
   at McMaster.Extensions.CommandLineUtils.CommandLineApplicationExtensions.<>c__DisplayClass9_0.<OnExecute>b__0()
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Dackup.Program.Main(String[] args)

This is the XML that I'm using:

<?xml version="1.0" encoding="utf-8" ?>
<perform name="XXXXX" compress="gzip">
    <archives>
    </archives>
    <databases>
        <database name="asdsadsadsadsa" type="postgres">
            <option name="host" value="asdasdsadsadsad"></option>
            <option name="port" value="5432"></option>
            <option name="database" value="asdasdsads"></option>
            <option name="username" value="asdsadsa"></option>
            <option name="password" value="sadsadsadsadasdsadas"></option>
            <option name="path_to_pg_dump" value="pg_dump"></option> <!-- AlSO TRIED OMMITING THIS -->
            <!-- see https://www.postgresql.org/docs/10/app-pgdump.html -->
            <additional_option name="--format" value="plain"></additional_option>
            <additional_option name="--compress" value="0"></additional_option>
        </database>
    </databases>
    <storages>
        <storage name="s3" type="s3" enable="true">
            <option name="remove_threshold" value="30d"></option>
            <option name="region" value="asdsadsa"></option>
            <option name="bucket" value="asdsadsadsadp"></option>
            <option name="path" value="/"></option>
            <option name="access_key_id" value="asdsadsadsadsad"></option>
            <option name="secret_access_key" value="sadsadsadsadsadsa"></option>
        </storage>
    </storages>
    <notifiers>
        <slack name="asdsadasdsadsa" on_success="true" on_warning="true" on_failure="true">
            <option name="webhook_url" value="asdsadsadsadsadsad"></option>
            <option name="channel" value="gsadsadsadsadsa"></option>
            <option name="username" value="dasdsadsadsadsa"></option>
            <option name="icon_emoji" value=":tape:"></option>
        </slack>
    </notifiers>
</perform>

I also tried to log into the container (/bin/sh) and I was able to execute pg_dump (assuming that was the issue since it's right after checking for pg_dump).

Any ideas on what am I doing wrong?

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.