LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-21-2011, 11:05 AM   #1
loveulinux
Member
 
Registered: Aug 2011
Posts: 68

Rep: Reputation: Disabled
rsync doubt


Hi....All,
Could anybody please tell, is there any problem while restoring. Because I have to do this because of some reasons.
1) "rsync -avz --progress source(UserPC)_dir desti(500GB_usbHDD)_dir"
2) "rsync -avz --progress source_(500GB_usbHDD)_dir desti(1TB_usbHDD)_dir"
3) rm -rf *(from 500GB)
Now does everything works fine if I restore directly from 1TB to user's PC ? Because 1TB HDD was backed up from 500GB HDD not directly from user's PC
4) "rsync -avz --progress source(1TB_usbHDD)_dir desti(UserPC)_dir"

I have one more doubt, how to find difference between two of the same main folders using diff command
I ran "diff source_dir desti_dir" it says common directories no changes. If I remove any one of the subdirectory then it will say only with that existing subdirectory. But if remove/modify any file inside the subdirectories it is not showing the difference.
 
Old 09-21-2011, 02:07 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,579
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
rsync copies files from one directory to another. So long as your command can see the source and the target and the target is as large or larger than the source it doesn't matter where it was originally created.

However, the main use of rsync is transfer from one server to another - if you're just copying to a USB device then physically moving it to another machine you might have just as much luck using a recursive copy (cp -r) rather than rsync.

Similarly diff checks files beneath a directory if both the source and target are directories but is not recursive unless you give the recursive flag (-r or --recursive).

Recursive means the directory and all subdirectories and files below it. Many commands will do that but often require you to put in a flag for it to insure you mean to do it.

Most UNIX/Linux commands have manual pages (a/k/a man pages) that you can get more information from so it you want more detail on the cp (copy) command type:
Code:
man cp
Or the diff command:
Code:
man diff
Or the rsync command:
Code:
man rsync
 
1 members found this post helpful.
Old 09-21-2011, 10:26 PM   #3
loveulinux
Member
 
Registered: Aug 2011
Posts: 68

Original Poster
Rep: Reputation: Disabled
rsync doubt

Thanks for your kind reply. I am using rsync because as per rsync info it copies only those if any modifications/changes are made since last backup and backing up is not for one time. Again after few weeks or months the employee may ask to backup because of bad condition of their laptop hard disk. So tell me which you would like to prefer now rsync or cp? If you tell for cp then does it not consume time as well as space?
And if you say for rsync, does everything works fine if I restore directly from 1TB HDD to user laptop during the restoration. Because the data which is stored in 1TB was not directly backed up from user's laptop, instead it was backed up from 500GB. I will be waiting for your kind reply.

Quote:
Originally Posted by MensaWater View Post
rsync copies files from one directory to another. So long as your command can see the source and the target and the target is as large or larger than the source it doesn't matter where it was originally created.
However, the main use of rsync is transfer from one server to another - if you're just copying to a USB device then physically moving it to another machine you might have just as much luck using a recursive copy (cp -r) rather than rsync.

Similarly diff checks files beneath a directory if both the source and target are directories but is not recursive unless you give the recursive flag (-r or --recursive).

Recursive means the directory and all subdirectories and files below it. Many commands will do that but often require you to put in a flag for it to insure you mean to do it.

Most UNIX/Linux commands have manual pages (a/k/a man pages) that you can get more information from so it you want more detail on the cp (copy) command type:
Code:
man cp
Or the diff command:
Code:
man diff
Or the rsync command:
Code:
man rsync
 
Old 09-22-2011, 02:33 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,579
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
As I noted in my original reply:

Code:
rsync copies files from one directory to another. So long as your command can see the source and the target and the target is as large or larger than the source it doesn't matter where it was originally created.
I wasn't saying you could NOT use rsync - I was just saying there were other ways to copy things from one server to another. You now say you're intent is to use it for backup and restore. You can do that but there are other ways of doing backups such as Bacula. I haven't used it myself but others on this forum have said good things about it:

http://www.bacula.org/en/
 
1 members found this post helpful.
Old 09-23-2011, 11:56 PM   #5
loveulinux
Member
 
Registered: Aug 2011
Posts: 68

Original Poster
Rep: Reputation: Disabled
rsync doubt

Sir, Thank you very much. You cleared my doubt by saying "rsync copies files from one directory to another. So long as your command can see the source and the target and the target is as large or larger than the source it doesn't matter where it was originally created".
I am using this because it is very user friendly. Since I don't have much experience about bacula, I can't say that I can't use it. But before using bacula on realtime I should be perfect. Thanks for clearing my doubts.

Quote:
Originally Posted by MensaWater View Post
As I noted in my original reply:

Code:
rsync copies files from one directory to another. So long as your command can see the source and the target and the target is as large or larger than the source it doesn't matter where it was originally created.
I wasn't saying you could NOT use rsync - I was just saying there were other ways to copy things from one server to another. You now say you're intent is to use it for backup and restore. You can do that but there are other ways of doing backups such as Bacula. I haven't used it myself but others on this forum have said good things about it:

http://www.bacula.org/en/
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync solaris + ld.so.1: rsync: fatal: libiconv.so.2: open failed: xxx_anuj_xxx Solaris / OpenSolaris 25 02-23-2012 04:23 AM
[SOLVED] rsync execution issue with crontab - Have given full path to rsync too!! Prabagaran Linux - Server 6 04-15-2011 02:39 AM
[SOLVED] rsync fails in cron - ssh key prob for rsync? jonathansfl Linux - Server 6 12-09-2010 10:48 AM
Could I run rsync to download files from a server without rsync daemon? Richard.Yang Linux - Software 1 09-18-2009 05:08 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 03:49 PM


All times are GMT -5. The time now is 04:32 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration