How can I write a script in Jenkins ( have a linux node) that will allow me to transfer a file, for e.g sample.txt which is present in the remote linux server to the artifactory ( Jfrog).
I am new to the whole SFTP from CLI since usually, I have done through the WinSCP UI and that too from my local to a remote server, so any pointers on where to get started will be helpful as well
As you are looking to deploy artifacts only through the Jenkins job, then you can use the DeployArtifact REST API, create a UNIX script based on your requirement, and then execute the same through the Execute shell option from the Jenkins job.
As a side note, if you are looking to deploy the artifacts that exists on the Jenkins VM to the Artifactory repository, then you can make use of the rtUpload method. You can refer to the JFrog wiki page here for more details with an example on the same.