I am new to these commands. I am trying to gzip a local folder and unzip the same on the remote server. The thing is, gzipping and unzip must happen on the fly. I tried many and one of the closest I believe is this:
tar cf dist.tar ~/Documents/projects/myproject/dist/ | ssh email@example.com:~/public_html/ "tar zx ~/Documents/projects/myproject/dist.tar"
As you can see above, I am trying to send out the dist folder to the remote server, but before that I am trying to compress the folder on the fly (looks like that is not happening in above command).
- local folder:
- remote folder:
~/public_html(directly deploying to live)
Of course, the gzip created file must not be there, it should happen on the fly.
My intention is to run the above like through a file like
sh file.command. In other words, I am trying to deploy my compiled project which is in
dist folder, to live when the
sh command is executed. I don't want to do this manually every time I make a change in my project.