Clone the repository into the specified folder (~/Developer/env-backup).
git clone https://github.com/adamtuby/env-backup.git ~/Developer/env-backupIf 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.
brew install fswatch flockEdit 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"
}
}
]
}python3 ~/Developer/env-backup/setup_env_backup.pyIt may require to enter password for the sake of sudo privileges.
bash bin/load.sh