Skip to content
/ xback Public

✨ A tiny backup and restore script

Notifications You must be signed in to change notification settings

metaory/xback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-backup

A very very simple (under 30 LoC) backup and restore tool written in pure Bash

Usage

  • link executables to your bin path

  • update the config cp sample.mbackup.conf mbackup.conf

  • place the config in a clean git directory

  • run mbackup

    • looks for a config file in current working directory,
    • parses the config
    • copy each file/dir of config path to ./data
  • run ./mrestore

    • looks for a ./config file in current working directory,
    • parses the config
    • restore each entry if exists in ./data

Sample Config

# AWM
/home/meta/.config/awesome/rc.lua
/home/meta/.config/awesome/mtheme.lua
/home/meta/.config/awesome/mlib

# Kitty
/home/meta/.config/kitty

# Tmux
/home/meta/.config/tmux

# Alacritty
/home/meta/.config/alacritty

How does it works

  • It parses the config for paths
  • Copy the path directory/file to ./data with all slashes replaced with _

For example path of /home/meta/tmp/js will go to ./m.dotfiles/data/_home_meta_tmp_js