-1

I want to copy all contents of a remote folder ( Windows ) into a local folder ( Linux ) :

Process proc = Runtime.getRuntime().exec("sshpass -p 'devaits@2019' scp 'devaits@app018ait:E:/Oxalys/RECETTE/*' /usr/Axian-Oxalys/xml/working/");

The directory "working" has rwx privileges for the root user proprietary.

The RECETTE folder contains subdirectories Oxadata/EXPORT. But at runtime the "working" directory is empty ! So why are the subfolders not copied ( created ) ?

pheromix
  • 18,213
  • 29
  • 88
  • 158

2 Answers2

1

You probably need -r option: scp -r 'devaits@app018ait:E:/Oxalys/RECETTE/*' /usr/Axian-Oxalys/xml/working/

Mikhail Efimov
  • 343
  • 1
  • 7
1

scp copies recursively only when the -r option is specified: man scp.

choroba
  • 231,213
  • 25
  • 204
  • 289