1.

Solve : SCP help?

Answer»

Hello,

I have been using scp command to transfer a bunch of files from ONE server to another server. The process is " (a) to CREATE the files, (b) transfer those from server X to server Y and (c) then PERFORM NEXT process". If NEXT (that is (c) ) process fails then then we retry the whole process. This mean we try to execute the scp command again. The twist is scp command fails if it finds that the files are already existent.

My question is that is there any way to forcibly COPY the files again or provide some option that step (b) does not give any error. The problem is that if I encounter any problem in scp command (that is (b) ), I re execute the whole process and I do not have the authority to delete any files on server Y, so I have to succed in the scp command.

Please help me if you have some suggestion
ShilpaAre you using the -r option? what options are you using?In my experiment I found that -r option actually overwrites the file. Its ok even though its It is a wastage of cpu cycles. My experiment in shell has worked well. Both the directories and files get overwritten. I am facing some problem doing it in Java but I think it will work out.

Thanks so much for the reply!
ShilpaI think rsync is probably a better tool for this job, given what you need it to do.

man rsync

and also

man rsyncd.conf

Hope this HELPS.



Discussion

No Comment Found