scp command in command line step of the workflow

saurabh0201

15-10-2015

Hi,

how to give scp command in command line step of workflow to copy a file from server.need to give username and password in the same command .

i have already tried the following commands :

scp ${file} USERNAME@pqrs.xyz.com desktop/xyz

scp ${file} USERNAME:'PASSWORD'@pqrs.xyz.com desktop/xyz

And getting the following exception :

org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:346)
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:149)
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:136)
    at com.day.cq.dam.core.process.CommandLineProcess.execute(CommandLineProcess.java:235)
    at com.day.cq.workflow.compatibility.CQWorkflowProcessRunner.execute(CQWorkflowProcessRunner.java:93)
    at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:208)
    at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:140)
    at org.apache.sling.event.jobs.JobUtil$1.run(JobUtil.java:365)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)

but somehow i am not able to copy it .

please let me know if you have any idea about the respective issue. 

Regards,

Saurabh 🙂

Accepted Solutions (1)

Accepted Solutions (1)

Sham_HC

15-10-2015

There are various ways like Using public keys without a passphrase  OR sshpass Or Expect . Check with your network team they will help with exact command.