Last active
November 14, 2022 07:27
-
-
Save joram77/dbcc62bd8834d2e0a04bdad59ec54c64 to your computer and use it in GitHub Desktop.
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
# copy current dir | |
cp -rv . ~/backup/$(basename "$PWD").bak.$(date '+%Y-%m-%d_%H-%M-%S') | |
# or tar current dir | |
tar -cvzf ~/backup/$(basename "$PWD").bak.$(date '+%Y-%m-%d_%H-%M-%S').tar.gz . | |
# tar current dir and exclude dot dirs/files in root to tar | |
tar --exclude="./.*" -cvzf /tmp/backup/$(basename "$PWD").bak.$(date '+%Y-%m-%d_%H-%M-%S').tar.gz . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment