From 196e8467d7e59ab790b0fdbe735256e25f73ac29 Mon Sep 17 00:00:00 2001 From: Aaron Lichtman Date: Tue, 2 Jun 2020 05:39:26 -0500 Subject: [PATCH] Update backup dotfiles script --- README.md | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/README.md b/README.md index d0b5d443..bceb9bc7 100644 --- a/README.md +++ b/README.md @@ -105,35 +105,7 @@ _If you choose to back up to a public repository, look at every file you're back `shallow-backup` makes this easy! After making your first backup, `cd` into the `dotfiles/` directory and run `$ git init`. Create a `.gitignore` and a new repo on your favorite version control platform. This repo will be maintained independently (manually) of the base `shallow-backup` repo. Note that you may need to use the `-separate_dotfiles_repo` flag to get this to work, and it may [break some other functionality of the tool](https://github.com/alichtman/shallow-backup/issues/229). It's ok for my use case, though. -Here's a `bash` script that I wrote to automate my dotfile backup workflow. You can use this by placing it in your `~/.zshrc` or `~/.bashrc`, sourcing the file, and then running `$ backup-dots`. - -```bash -# Usage: backup-dots [COMMIT MESSAGE] -backup-dots () { - echo "Backing up..." - crontab -l > ~/.config/crontab - ( - shallow-backup -no-splash -backup-dots -separate-dotfiles-repo - cd "$HOME/shallow-backup/dotfiles/" || exit - git add . - commit_msg="$1" - if [ -z "$commit_msg" ] - then - git commit --verbose - else - git commit -m "$commit_msg" - fi - git pull - if [ "$?" -ne 0 ] - then - echo "Merge conflict detected. Fix manually in subshell and Ctrl-D when done." - git status - $SHELL - fi - git push - ) -} -``` +Here's a `bash` script that I wrote to [automate my dotfile backup workflow](https://github.com/alichtman/scripts/blob/master/backup-and-update-dotfiles.sh). You can use this by placing it in your `$PATH`, making it executable, and running it. ### What can I back up? ---