Skip to content

Instantly share code, notes, and snippets.

@hthuong09
Created March 25, 2024 17:43
Show Gist options
  • Save hthuong09/cab8cbc18d3861818b3db0192fc94d81 to your computer and use it in GitHub Desktop.
Save hthuong09/cab8cbc18d3861818b3db0192fc94d81 to your computer and use it in GitHub Desktop.
Quick backup restore mac
rsync -vaE --progress --delete-after --human-readable --relative \
--exclude node_modules \
--exclude .DS_Store \
# folder to backup
~/SoureCode \
~/.gnupg \
# data foldler
~/Library/Application\ Support/another-redis-desktop-manager \
~/Library/Application\ Support/com.tinyapp.TablePlus \
~/Library/Application\ Support/Postman \
~/Library/Application\ Support/zoom.us \
~/Library/DBeaverData \
# data folder
~/.config/xxx \
/Users/xxx/backup
cd /Users/xxx/backup
tar -czvf backup.tar.gz Users/xxx
cd /Users/xxx
tar -xzvf backup.tar.gz backup
rsync -rvl backup/Users/xxx/ $HOME/ # the / at the end of source and destination are needed otherwise full path will be included
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment