Created
June 19, 2018 09:57
-
-
Save ArneGockeln/8f1eb9043559786602f564b309e0feb1 to your computer and use it in GitHub Desktop.
Create tar.gz archives inside _backup directory for all directories in path
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
# create folder _backup inside search path if it does not exist | |
mkdir -p _backup | |
# this finds all directories inside . excluding _backup and executes tar cvzf command. | |
# it creates a tar archive inside _backup folder with the name <foldername>.tar.gz | |
find . -mindepth 1 -maxdepth 1 -type d -not -path "./_backup" -exec tar cvzf _backup/{}.tar.gz {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment