Hello everybody, how are you?
I hope someone can help me!
I would like to write a script which zips automatically
a complete directory structure.
For example, there is a directory dirA which contains, say,
5 subdirs sdirA1 .. sdirA5.
Another dir dirB which contains 3 subdirs sdirB1 .. sdirB3. And so on.
Now I would like to zip each subdir in dirA and dirB separately:
for i in list_of_directories <---dirA,dirB,..
do
cd $i
for j in list_of_subdirs <---sdirA1..sdirA5,sdirB1..
do
tar -cf $j.tar $j/*
bzip2 $j.tar
done
cd ..
done
Thank you in advance!
I hope someone can help me!
I would like to write a script which zips automatically
a complete directory structure.
For example, there is a directory dirA which contains, say,
5 subdirs sdirA1 .. sdirA5.
Another dir dirB which contains 3 subdirs sdirB1 .. sdirB3. And so on.
Now I would like to zip each subdir in dirA and dirB separately:
for i in list_of_directories <---dirA,dirB,..
do
cd $i
for j in list_of_subdirs <---sdirA1..sdirA5,sdirB1..
do
tar -cf $j.tar $j/*
bzip2 $j.tar
done
cd ..
done
Thank you in advance!