| path_A=./ | |
| path_B=./ | |
| # # Packing phase | |
| # for dir in images_part{00..34}; do | |
| # ( | |
| # echo "Starting to pack $dir at $(date)" | |
| # # Pack the directory from path_A and save the tar file to path_B | |
| # tar -cvf ${path_B}/${dir}.tar -C ${path_A} ${dir} | |
| # echo "$dir packed successfully at $(date)" | |
| # ) & | |
| # done | |
| # wait | |
| # Unpacking phase | |
| for dir in images_part{00..00}.tar; do | |
| ( | |
| cd ${path_B} | |
| # Extract the base name from the tar file | |
| base_name=$(basename "$dir" .tar) | |
| echo "Starting to unpack $dir at $(date)" | |
| # Extract the contents of the tarball | |
| tar -xvf ${dir} | |
| echo "$dir unpacked successfully at $(date)" | |
| ) & | |
| done | |
| wait | |