Friday, February 1, 2013

How to create .tar files for all folders under a directory

How to create .tar files for all folders under a directory:
I have hundreds of project directories under one folder. Now I want to create .tar files for these projects. Is is fairly easy to tar multiple directories to one .tar file:
tar cvf /myStorage/allProjects.tar project1 project2 project3 project4
But I needed one .tar file per project. To keep .tar files seperate. So I needed to have:
/myStorage/project1.tar
/myStorage/project2.tar
/myStorage/project3.tar
/myStorage/project4.tar
To accomplish this, I needed to write a bash script:

More...
Post a Comment