0

I am trying to compress my folder, send it to the server, and decompress it. I set up the ssh-keygen so that scp and ssh works without password. However, once the ssh user@server line is executed, the remaining lines are not executed since the control is transferred to the server. Any ideas on how to accomplish this? I am not sure how to make this as a minimum-reproducible example.

tar -czvf targetfolder.tar.gz targetfolder
echo "zipped targetfolder; moving to server"
scp targetfolder.tar.gz user@server:
ssh user@server
cd ~/targetfolderonserver
rm -rf targetfolder
mv ~/targetfolder.tar.gz ./
tar -xf targetfolder.tar.gz
lifezbeautiful
  • 1,160
  • 8
  • 13

0 Answers0