LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-09-2011, 09:16 AM   #1
centosfan
Member
 
Registered: Jun 2003
Location: Golem city
Distribution: Server - Debian Desktop - Linux Mint
Posts: 219

Rep: Reputation: 32
SCP or rsync?


What do you use for transferring files from one to another server?So far i was using scp command,but i see rsync function basically same,except i heard how rsync copies files in realtime.Also is it possible to insert password in command(for automated backup purposes) or that can be arranged only by using ssh keys?
 
Old 01-09-2011, 09:24 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
I prefer rsync as it's more flexible, don't expose the password - distribute the keys
 
Old 01-09-2011, 03:25 PM   #3
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Each has its own place. You haven't described your situation. I use a variety of tools depending on the situation. If I'm just looking to copy one or a few files or a small directory, I'll use scp, just because it is so simple and works. If I'm copying a large directory that's going to take a long time and I don't want to lose time if there are any problems or failures, I'll do it with rsync. Then I can just do the same command again, and it will clean up any differences much more quickly. There are also times when I'll use gnutar or ufsdump (I'm on Solaris systems mostly). I also have some scripts that pipe the results of a find to cpio.
 
Old 01-09-2011, 07:07 PM   #4
centosfan
Member
 
Registered: Jun 2003
Location: Golem city
Distribution: Server - Debian Desktop - Linux Mint
Posts: 219

Original Poster
Rep: Reputation: 32
Well what i plan to do is to set up automatic backup with cron of databases and home files.For databases i would simply copy /var/lib/mysql directory.
 
Old 01-09-2011, 08:02 PM   #5
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
If you are backing up databases, simple copies or rsync may not give you consistent backups. Take a look at http://dev.mysql.com/doc/refman/5.1/...p-methods.html. You could dump your databases to a different directory and then back that up.

Also, without additional thought and effort, using scp or rsync to simply copy a directory out will leave you with only one backup. If you happen to pull some kind of snafu late in the evening, and then your backup runs, when you get up in the morning, you will find that both your primary data and your backup are snafu'd (because the backup copied the messed up stuff and overwrote the backup with it).

So, if you are thinking about using rsync, take a look at doing snapshot style incremental backups with it. The classic description of how to do this is http://www.mikerubel.org/computers/rsync_snapshots/. This idea has been developed into a number of different backup packages, including http://rsnapshot.org/, http://www.ubuntugeek.com/flyback-sn...-on-rsync.html, http://rdiff-backup.nongnu.org/acknowledgments.html, & others. Google could keep you busy for a while investigating alternatives if you wanted to do that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux scp or rsync without password sanjee Linux - Server 15 09-13-2012 02:46 PM
I think I need rsync or scp -- something to copy from http://... to /somewhere/else nithra Linux - Server 2 01-18-2011 06:09 AM
[SOLVED] rsync -z vs. scp ... which one is faster over network? someshpr Linux - General 5 12-08-2010 06:06 PM
Auto syncing folder from Linux to Windows, SCP/Rsync? batfastad Linux - Software 2 11-26-2010 02:08 AM
Home network is fine, until i try to rsync/scp lagartoflojo Linux - Networking 4 01-15-2006 09:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration