Created
January 6, 2023 05:12
-
-
Save abdennour/3d3f9b686c6fde7c08f42310f3c40288 to your computer and use it in GitHub Desktop.
In Parallel TAR Archive Subfolders - Bash
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
src=$1 | |
dest=$2 | |
cd ${src} | |
for i in * | |
do | |
( | |
if [ -d "$i" ];then | |
tar czvf "${dest}/$i.tar.gz" -C "$i" . | |
else | |
echo skiping $i as it is not folder | |
fi | |
sleep 1 | |
) & | |
done | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment