I am going over some documentation from a former colleague of mine. This documentation pertains to creating a distro repo. However, I cannot understand exactly what this commands performs:
[beamin@repo ks]# cd /mnt/
[beamin@repo mnt]# ls
centos-1 centos-2 centos-3
[beamin@repo mnt]# for i in 1 2 3
> do
> cd /mnt/centos-$i
> tar cpf - . | ( cd /var/ftp/ks/centos/; tar xpf - )
> done
My (obviously incorrect) rundown of it is: Loop through every mounted CD (/mnt/centos-<index>) and create a tar of the folder preserving the permissions. Then, extract that tar file to another folder, again, preserving permissions.
If that is the case, why do it like this? Is there really not a better way? Or perhaps I'm missing the whole idea.