Linux - NewbieThis 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

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

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.

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:

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

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:

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:

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

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: