Details
-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
0
-
1
-
Description
Problem Definition
The SCP task takes over ownership of the file, therefore locking everyone else out except for the service account that SCPs the file.
If a file is created without the group write bit set, it will result in permission issues. So ideally, we'd like the ability to configure the SCP task to do something similar to:
chmod g+w <file> scp <file>
Even if a Script task is created before the SCP that performs the chmod on the file, the SCP task does not preserve the group write bit which doesn't match the behavior of (this does preserve it):
chmod g+w target/test.jar
sshpass -p "password" scp target/test.jar user@host:/home/user
Suggested Solution
If possible, preserve permissions at destination of SCP task
Workaround(s)
- Create a Command Task
- Add rsync as an executable
- Example argument: -avz --rsh=ssh --chmod g+w ./ <user>@<destinationhost>:/<target>/<dir>
- This will copy the entire contents of the working directory to the remote server and set the group write bit in the same operation.
- You will also need to setup your SSH keypair between the hosts.
or
- Add a script task to chmod the file first
- Add a Command Task with SCP executable. You will still need the script task to chmod it.
or
- Use an SSH task after the SCP to SSH in and chmod the files at destination