I have rsync command to be run in a java program...the problem i am facing is that rsync requires a password to be entered and i am not understanding how to pass this passwo
You can write to the output stream of the Process
, to pass in any inputs. However, this will require you to have knowledge of rsync
's behavior, for you must write the password to the outputstream only when the password prompt is detected (by reading the input stream of the Process
).
You may however, create a non-world readable password file, and pass the location of this password file using the --password-file
option when you launch the rsync
process from Java.