After SSH into remote webserver, I execute the following command on CentOS remote web server:
tar -vcf remote_name.tar /home/remote_name/public_html
On my local sys (Debian based), I execute the following:
$ wget https://example.com/remote_name.tar
$ mkdir remote_name
$ tar -vxf remote_name.tar --directory ./remote_name
All good, BUT... I don't want the dir structure the way it results as:
Instead, I want the result to be as:
where the resulting files under new location,
/var/www/html/remote_name would be the mirror of original location, excluding the parent directory structure.
Considering my result w/ commands as illustrated above, the files which now reside in
/var/www/html/remote_name/home/remote_name/public_html must be moved from to my desired location
/var/www/html/remote_name/. I want to skip that step with an improvement to my commands.
I presume this can be set w/ args on the
tar command as desired when I'm SSH at remote_location, but I don't know the correct arguments to achieve what I want.
Your assistance is much appreciated!