scp command in command line step of the workflow | Community
Skip to main content
New Participant
October 16, 2015
Solved

scp command in command line step of the workflow

  • October 16, 2015
  • 3 replies
  • 1589 views

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 :)

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

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.

3 replies

Sham_HC
New Participant
October 16, 2015

Refer scp documentation. The parameter supplier is wrong that the after hostname you will have colon with path and there is no space.

New Participant
October 16, 2015

hey sham,

Thank you for your reply , it will be very helpful if you could give syntax  for it .

Regards,

Saurabh

Sham_HC
Sham_HCAccepted solution
New Participant
October 16, 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.