Created
March 25, 2024 17:43
-
-
Save hthuong09/cab8cbc18d3861818b3db0192fc94d81 to your computer and use it in GitHub Desktop.
Quick backup restore mac
This file contains 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
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 |
This file contains 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
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