-
Notifications
You must be signed in to change notification settings - Fork 0
/
backup.sh
executable file
·40 lines (34 loc) · 894 Bytes
/
backup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
### Varibales
DOTFILES="configs/dotfiles"
VSCODE="configs/vscode"
KEYCHAINS="configs/keychains"
### Cleanup previous backups
rm -rf configs
### Create folders
mkdir configs
mkdir configs/dotfiles
mkdir configs/keychains
mkdir configs/vscode
### Backup dotfiles
echo "Backing up zsh"
cp ~/.zsh_history $DOTFILES/
cp ~/.zshrc $DOTFILES/
echo "Backing up gitconfig"
cp ~/.gitconfig $DOTFILES/
cp ~/.gitignore_global $DOTFILES/
echo "Backing up hyper.js"
cp ~/.hyper.js $DOTFILES/
echo "Backing up ssh"
cp -rf ~/.ssh $DOTFILES/
echo "Backing up Keychains"
cp -rf ~/Library/Keychains/* $KEYCHAINS/
### Backup VSCode user data and extensions list
echo "Backing up VSCode user data"
cp -rf ~/Library/Application\ Support/Code/User/*.json $VSCODE/
echo "Backing up VSCode extensions list"
code --list-extensions > $VSCODE/extensions
### Finish
echo ""
echo "Backup successful"
exit 1