I am trying to overwrite some directories with content in them on a remote location using
pscp to a remote location. I use root user (
root@locationServerName). It succeeds in most of them, but fails in some of them returning
$? = 1.
The output of the command looks like that:
Sending file filename1.txt, size=2990 filename1.txt | 2 kB | 2.9 kB/s | ETA: 00:00:00 | 100% Sending file filename2.txt, size=2665135 filename2.txt: unable to open /path/to/file/location/filename2.txt: failure Sending file filename3.txt, size=2990 filename3.txt | 2 kB | 2.9 kB/s | ETA: 00:00:00 | 100%
It looks like for some reason it can't overwrite the files, but I can't figure why or how could I fix it. Running it in verbose mode, doesn't say anything helpful. If I delete the files manually on the target location, then the operation succeeds.