Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've only used SCP to copy a lot of files, and never cared if they existed on the destination... can this be done with scp? Is there another solution that would be better?

It's copying from one server to another.

share|improve this question
add comment

2 Answers

I use rsync.

See http://www.manpagez.com/man/1/rsync/

DESCRIPTION

       Rsync is a fast and extraordinarily versatile file  copying  tool.   It
       can  copy  locally,  to/from  another  host  over  any remote shell, or
       to/from a remote rsync daemon.  It offers a  large  number  of  options
       that  control  every  aspect  of  its behavior and permit very flexible
       specification of the set of files to be copied.  It is famous  for  its
       delta-transfer  algorithm,  which  reduces the amount of data sent over
       the network by sending only the differences between  the  source  files
       and  the  existing  files in the destination.  Rsync is widely used for
       backups and mirroring and as an improved copy command for everyday use.

       Rsync  finds  files  that  need to be transferred using a "quick check"
       algorithm (by default) that looks for files that have changed  in  size
       or   in  last-modified  time.   Any  changes  in  the  other  preserved
       attributes (as requested by options) are made on the  destination  file
       directly  when  the quick check indicates that the file's data does not
       need to be updated.
share|improve this answer
    
+1 rsync is the right tool and running it over ssh provides the security of scp. –  sybreon Sep 2 '11 at 13:29
add comment

In the (unlikely) eventuality that your needs exceed rsync's capabilities, you may want to consider rdist.

   Rdist is a program to maintain identical copies of files over multiple hosts.  It preserves the owner, group, mode, and mtime of files  if  possible  and  can
   update  programs that are executing.  Rdist reads commands from distfile to direct the updating of files and/or directories.  If distfile is ‘-’, the standard
   input is used.  If no -f option is present, the program looks first for ‘distfile’, then ‘Distfile’ to use as the input.  If no names  are  specified  on  the
   command  line, rdist will update all of the files and directories listed in distfile.

Cheers.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.