I want to add a directory to tar by it's name and absolute path. Please remember I want to add directory itself and not just it's contents.
tar -czpvf arc.tar.gz -C /var/www/html/directory_to_add
I am running above code but system returns
"tar: Cowardly refusing to create an empty archive
Try 'tar --help' or 'tar --usage' for more information."
If I run
tar -czpvf arc.tar.gz -C /var/www/html/directory_to_add .
then the contents of directory_to_add will be added and not the directory itself.
Is there any solution to add the directory itself by using absolute path.
I am making a script in PHP but I found no solution with PHP inbuilt class PharData
Please help. Thanks in advance.