A central configuration for commands, especially backup commands. https://backy.cybershell.xyz/
Go to file
Andrew 03f54c8714 Added command and list execution (#1), small touchups
- Added exec command to execute individual commands
- Added --lists, -l flag to backup command
  - Run command lists (#1)
- Small touchups and documentation
2023-01-20 02:42:52 -06:00
.vscode add module 2022-10-13 12:07:16 -05:00
cmd Added command and list execution (#1), small touchups 2023-01-20 02:42:52 -06:00
examples A runnable command 2023-01-17 00:55:28 -06:00
pkg Added command and list execution (#1), small touchups 2023-01-20 02:42:52 -06:00
.gitignore small changes, added goreleaser 2023-01-17 22:47:34 -06:00
.goreleaser.yaml fix: gitea url 2023-01-18 01:35:46 -06:00
backy.go A runnable command 2023-01-17 00:55:28 -06:00
go.mod fixes 2023-01-17 00:57:23 -06:00
go.sum fixes 2023-01-17 00:57:23 -06:00
License A runnable command 2023-01-17 00:55:28 -06:00
Makefile small changes, added goreleaser 2023-01-17 22:47:34 -06:00
PLAN.md first commit 2022-10-13 12:03:36 -05:00
README.md Added command and list execution (#1), small touchups 2023-01-20 02:42:52 -06:00
release added release 2023-01-18 01:48:39 -06:00

Backy - an application to manage backups

This app is in development, and is currently not stable. Expect core functionality to possiblly break.

Installing

To install:

go install git.andrewnw.xyz/CyberShell/backy@master

This assumes you already have a working Go environment, if not please see this page first.

You can also download binaries here and here.

Features

  • Define lists of commands and run them

  • Execute commands over SSH

  • More to come.

To run a config:

backy backup

Or to use a specific file: backy backup -c /path/to/file

If you leave the config path blank, the following paths will be searched in order:

  • ./backy.yaml
  • ~/.config/backy.yaml

Create a file at ~/.config/backy.yaml:

commands:
  stop-docker-container:
    cmd: docker
    cmdArgs:
      - compose
      - -f /some/path/to/docker-compose.yaml
      - down
    # if host is not defined, 
    host: some-host 
    env: ~/path/to/env/file
  backup-docker-container-script:
    cmd: /path/to/script
    host: some-host
    env: ~/path/to/env/file
  shell-cmd:
    cmd: rsync
    shell: bash
    cmdArgs:
      - -av some-host:/path/to/data ~/Docker/Backups/docker-data
  hostname:
    cmd: hostname

cmd-configs:
  # this can be any name you want
  cmds-to-run: 
    # all commands have to be defined
    order:
      - stop-docker-container
      - backup-docker-container-script
      - shell-cmd
      - hostname
    notifications:
      - matrix
  hostname:
    order:
      - hostname
    notifications:
      - prod-email

hosts:
  some-host:
    config:
      usefile: true
      user: root
      private-key-path:

logging:
  verbose: true
  file: /path/to/logs/commands.log


notifications:
  prod-email:
    id: prod-email
    type: mail
    host: yourhost.tld
    port: 587
    senderAddress: email@domain.tld
    to:
      - admin@domain.tld
    username: smtp-username@domain.tld
    password: your-password-here
  matrix:
    id: matrix
    type: matrix
    homeserver: your-home-server.tld
    room-id: room-id
    access-token: your-access-token
    user-id: your-user-id

Note, let me know if a path lookup fails due to using Go's STDLib os