Created
October 19, 2015 06:50
-
-
Save iamssen/67debc79d0f6a9275bab to your computer and use it in GitHub Desktop.
Macbook Backup Shell Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Jenkins Environment Variables | |
| # $HOME | |
| # $DROPBOX | |
| # Jenkins Task Setting | |
| # Cron Schedule: H H/24 * * * | |
| # Execute Shell Script: sh "$DROPBOX/Macbook Backup Every Day.sh"; | |
| export PATH=/usr/local/bin:$PATH; | |
| export BACKUP="$DROPBOX/Macbook Backup"; | |
| mkdir -p "$DROPBOX/Macbook Backup"; | |
| cd "$HOME/.config/fish/nvm-wrapper"; | |
| git pull; | |
| cd $HOME; | |
| tar -cvzf "$BACKUP/Workspace.tar" \ | |
| --exclude ".git" \ | |
| --exclude "node_modules" \ | |
| --exclude "bin-debug" \ | |
| "Workspace"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Jenkins Environment Variables | |
| # $HOME | |
| # $DROPBOX | |
| # Jenkins Task Setting | |
| # Cron Schedule: H H/2 * * * | |
| # Execute Shell Script: sh "$DROPBOX/Macbook Backup Every Hour.sh"; | |
| export PATH=/usr/local/bin:$PATH; | |
| export NVM_DIR=$HOME/.nvm; | |
| source $(brew --prefix nvm)/nvm.sh; | |
| export BACKUP="$DROPBOX/Macbook Backup"; | |
| mkdir -p "$DROPBOX/Macbook Backup"; | |
| cd $HOME; | |
| # Develop Environments | |
| npm ls -g --depth=0 > "$BACKUP/npm ls.txt"; | |
| tar -cvzf "$BACKUP/node.tar" \ | |
| ".nvm/nvm.sh" \ | |
| ".config/configstore"; | |
| tar -cvzf "$BACKUP/ssh.tar" \ | |
| ".ssh"; | |
| tar -cvzf "$BACKUP/git.tar" \ | |
| ".git" \ | |
| ".gitconfig"; | |
| # OSX Utils | |
| ls /usr/local/bin > "$BACKUP/ls usr.local.bin.txt"; | |
| brew ls > "$BACKUP/brew ls.txt"; | |
| tar -cvzf "$BACKUP/fish.tar" \ | |
| ".config/fish"; | |
| # OSX Config | |
| ls -al "$HOME/Links" > "$BACKUP/ls Links.txt"; | |
| tar -cvzf "$BACKUP/LaunchAgents.tar" \ | |
| "Library/LaunchAgents"; | |
| tar -cvzf "$BACKUP/Services.tar" \ | |
| "Library/Services"; | |
| tar -cvzf "$BACKUP/Keymaps.tar" \ | |
| "Library/Preferences/com.apple.symbolichotkeys.plist" \ | |
| "Library/Preferences/pbs.plist"; | |
| # Apps | |
| ls /Applications > "$BACKUP/ls Applications.txt"; | |
| tar -cvzf "$BACKUP/IntelliJIdea15.tar" \ | |
| "Library/Preferences/IntelliJIdea15"; | |
| tar -cvzf "$BACKUP/sublime Text.tar" \ | |
| "Library/Application Support/Sublime Text 3/Packages" \ | |
| "Library/Application Support/Sublime Text 3/Installed Packages"; | |
| tar -cvzf "$BACKUP/Alfred.tar" \ | |
| "Library/Application Support/Alfred 2"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment