Originally Posted by GuruduttMarathe
Sorry for typo error.
I tried the below command:
tar zvcf rootfs/rootfs.tar.gz .
^^^this is not going to happen !
tar zvcf rootfs/rootfs.tar.gz
TAR uses -f for filename, so basically you're telling Tar to create the archive file in path "rootfs
/rootfs.tar.gz" with filename "rootfs.tar.gz"
What is then important is if you want to include directories you need the -R switch, so the full command would be:
tar cvzRf rootfs.tar.gz rootfs/
this will create (-c) the archive "rootfs.tar.gz" from the directory "rootfs/" and below (rootfs/etc, rootfs/var ...)