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.

What method is the most script-friendly for moving files between servers?

The only methods I know of are SSH and rsync, but I don't want to jump into them if there is something else that is a standard.

EDIT:

The servers in question run on Red Hat Enterprise and Centos5

share|improve this question

3 Answers 3

up vote 5 down vote accepted

scp, sftp, rsync, are probably as close to standard as you get if you don't want to mount the remote filesystem.

If you are the same network, it would be somewhat common to also do an nfs mount of the remote system. Though if you are only infrequently moving files, this probably won't make much sense.

share|improve this answer
    
Looks like I'm sticking w/rsync. Creating the nfs mount isn't worth it for us. That was my first thought though, however we're only moving a couple files a week, and we don't want to leave an "Access Hole" open to this particular server. –  Mechaflash Jan 27 '12 at 14:23

There are as many ways to do this as stars in the sky. Well maybe not that many but a lot.

  • curl
  • wget
  • FTP
  • sftp
  • ftps
  • scp
  • cat | ssh
  • rsync
  • rsync over ssh
  • NFS
  • samba
  • sneakernet (hah!)

If I had to pick one I'd probably pick scp with an ssh-keypair. I'd be able to give a more specific recommendation if I knew more about your use case.

share|improve this answer
    
that's a huge list =D. I think i'm going to stick with rsync. I did a test yesterday, and the command is simple enough to handle the few files that I have. –  Mechaflash Jan 27 '12 at 14:21

I use Perl scripts based on the Net::SFTP::Foreign module. I find that this combination is easier to code for error detection, email reporting, file permission control, and fine grain attribute settings. The list of features this approach provides is extensive and can be viewed here:

http://search.cpan.org/~salva/Net-SFTP-Foreign-1.69/lib/Net/SFTP/Foreign.pm

share|improve this answer
    
thanks for the information, however I'm not familiar with perl. –  Mechaflash Jan 27 '12 at 14:20

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.