Giter VIP home page Giter VIP logo

backer's Introduction

Backer

Rsync wrapper to do multiple transfers from a single yaml file.

Why

I'm sure there is lots of implementations already exist doing the same, but i wanted to some golang rsync wrapper that will do some routine backups using my own yaml file specs. Since i already have multiple directories that i update daily, i wanted to always make sure that i have them synced and moved to a persistent location since some of these files are not and won't be hosted on github.

How

Backer will generate a new config file under ~/.config/backer/config.yaml there you're expected to modify and enter your sources & destinations.

Config file

backer:
  # you can add multiple transfer levels
  transfer:
    # make sure that both source & destination paths are absolute
    - source: /home/john/personal-stuff/
      destination: /run/media/john/some-mounted-hdd/personal/
    - source: /home/john/pictures/
      destination: /run/media/john/some-mounted-hdd/pictures/
  # these exclude args will be later fed to rsync --exclude, by default this will be empty
  exclude:
    - log
    - logs
    - "*.log"
    - "node_modules"
    - vendor
    - .git
    - .next
  # here you can just add rsync options you want to supply by default this will be empty
  rsync_options:
    - -avAXEWSlHh
    - --no-compress
    - --info=progress2

The CLI

Currently you could use backer directly to copy from a single source to single destination:

backer /home/john/a/ /home/john/b/

You can also add rsync options:

backer /home/john/a/ /home/john/b/ -o '-avAXEWSlHh' -o '--no-compress'

Cron

Currently since I'm using Arch - by the way ;) - I use systemd to periodically run backer every hour, you can find the systemd service and timer under ./systemd

You will need to make some proper changes to the service to point to the proper user & group and backer location

[Service]
Type=simple
User=mrgeek # change this
Group=mrgeek # change this
ExecStart=/home/mrgeek/go/bin/backer # change this

then you can run ./sync to sync and start backer timer

cd ./systemd
./sync

Install

If you already have go installed then:

go install github.com/omarahm3/backer@latest

Or from releases page

backer's People

Contributors

omarahm3 avatar

Stargazers

 avatar  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.