Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: SCP help  (Read 3723 times)

0 Members and 1 Guest are viewing this topic.

shilpa.unl

  • Guest
SCP help
« on: January 30, 2008, 03:51:14 PM »
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
Shilpa

michaewlewis



    Intermediate
  • Thanked: 26
    • Yes
    • Yes
  • Experience: Expert
  • OS: Unknown
Re: SCP help
« Reply #1 on: January 30, 2008, 05:39:54 PM »
Are you using the -r option? what options are you using?

shilpa.unl

  • Guest
Re: SCP help
« Reply #2 on: February 01, 2008, 01:05:39 PM »
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!
Shilpa

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: SCP help
« Reply #3 on: February 07, 2008, 05:55:52 AM »
I 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.
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos