SCPClient:Error: transfer failed because of "scp -p" command
Hello. We have a recurring issue when files are copied between servers. The reason is because of the "scp -p" command. The "-p" tells scp to preserve modification times, access times and modes from the original file. Unfortunately this doesn't work if copying to the target location and the target location already has a file by the same name but owned by a different user. Even if the file permissions are 777.
We can remove the file on the target server and then the transfer will succeed the next time it is migrated.
However, does anyone know if we can change the command being used from "scp -p" to just "scp"? This will resolve our issue. We don't care if the times are preserved from the source.
I haven't been able to figure out where "scp -p" is coded. Possibly it is in the binaries and cannot be changed.
Re: SCPClient:Error: transfer failed because of "scp -p" command
This is hard coded in the source code. If you want to be able to turn off the "-p" parameter, you'll need to open an Enhancement Request with Micro Focus Support.
I do have a few questions:
1) What PPM Version are you using, and do you have any plan for upgrade in the next year?
2) What version of the File copy protocol are you using? SCP or SCP2 (Legacy) or SCP2?
3) Are you sure that there won't be any side effects of removing -p and thus get a different timestamp for the copied file? Can't you think of a scenario where that would be a problem?