I want to take tar from a logged in shell and take that tar file to a remote host and then extract the tar file over there. I've got below command but the tar itself is not creating.
time=`date`
timestamp=`date +%F_%H%M`
backpfilename=db${timestamp}.tar.gz
cd /home/aryan/ && tar -cvzf $backupfilename | ssh root@remoteserver 'cd /home/aryantest/ && tar -xvzf $backpfilename'