Skip to content

adamtuby/env-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MacOS Backup System

Clone the repository into the specified folder (~/Developer/env-backup).

git clone https://github.com/adamtuby/env-backup.git ~/Developer/env-backup

If you so defiantly not do so, you would have to adapt the git repo dir's entry it in the config.json file.
If you are reading this after exhaustingly debugging, I suspect there's a lesson to be learned here.

Requirements

Prerequisites

brew install fswatch flock

Config file

Edit the config file to back your directories of interest (config.json).

Config example:

{
  "git_repo_dir": "~/Developer/env-backup",
  "git_branch": "main",
  "debounce_seconds": 20,
  "entries": [
    {
      "name": "zshrc",
      "type": "file",
      "watch": true,
      "src": "~/.zshrc",
      "dst_repo": "~/Developer/env-backup/dotfiles/.zshrc"
    },
    {
      "name": "unms_research",
      "type": "dir",
      "watch": true,
      "src": "~/UNMS/Research",
      "dst_repo": "~/Developer/env-backup/UNMS/Research",
      "excludes": [".DS_Store", "Icon?", "*.swp", "*.tmp"]
    },
    {
      "name": "research_un_ms",
      "type": "dir",
      "watch": true,
      "src": "~/Library/Application Support/research.un.ms",
      "dst_repo": "research.un.ms", // Notice the relative path? Yes. Both absolute and relative paths to the repo directory work (it'll be saved in the repo's backup dir (REPO/backup) though)
      "excludes": [".DS_Store", "Icon?", "*.swp", "*.tmp"],
      "icloud_mirror": {
        "dst": "~/Library/Mobile Documents/com~apple~CloudDocs/UNMS-Research-Sync-Backup/research.un.ms",
        "use_backup_archive": true,
        "backup_dir_name": "backup-archive",
        "exclude_backup_dir": "backup-archive"
      }
    }
  ]
}

The setup script (run once)

python3 ~/Developer/env-backup/setup_env_backup.py

It may require to enter password for the sake of sudo privileges.

Setup script for login extension

bash bin/load.sh

Backups stored at the backup directory. Enjoy.

About

A backup system for every lightweight's file (be it config or some offline app's files)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages