Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Well, I did it. It took me a few times to get it right but I did a backup using rsync, although I am still curious what the "--delete-after" part does...I sure would like to know that. The man page is uncomprehensible.
One last question on this...is there any way to "verify", to make sure the backup matches the original?
Thanks again, now ready to move on to the next Linux challenge.
axelfc:
I installed grsync "using apt-get install grsync" and it worked perfectly. Exactly what I was looking for. Thanks again.
Do either one of you or anyone else know what directories should be backed up in case of disaster....right now I am backing up everything on my /home/joe directory. Should I be backing up the / directory in its entirety (everything on the root partition)?
Should I be backing up the / directory in its entirety (everything on the root partition)?
Depends. If anything goes wrong, you can always do a fresh install. As long as your personal data are backed up, you won't lose anything. If your system is highly customized and you don't want to put in all that work again, then yes, having a back up or an image of your complete system would be worth considering.
A good practice in Linux is to have /home in a different partition. /home apart from your personal data has the configuration files for the programs you are using. Thus if you format and reinstall the same programs you won't have to configure them again as long as /home stays untouched. So taking a backup of /home is a good idea.
I think I'll backup the / partition just to be safe, as I have spent a long time tweaking the system and have downloaded and installed several programs I need on a daily basis.
How about this one?
Quote:
is there any way to "verify", to make sure the backup matches the original?
And lastly, how do I restore using rsync...is it just a matter of copying...as in cp mastercopy /...like that? or do I reverse the order and use the backup as the source and the original as the backup and use rsync normally?
If you look at the man page there is the
-c (--checksum)
option, but its largely superfluous as rsync uses checksums anyway to determine what to send. One of the core points about rsync is it only sends differences, so it doesn't need to send whole files unless its a new file.
In principle you can just use the cp cmd for local disk to disk copies (maybe using -r) as rsync copies the files as-is, so you end up with normal files, not some special 'stored format' equivalent.
Its just more powerful/flexible.
it looks like I'll be trying rsync first, it looks simple and efficient.
so I should be able to do:
EX. 1
Code:
rsync -av --delete-after sdb1 sdc1
or EX. 2
Code:
rsync -av --delete-after /home/joe sdc1
EX 1 would backup Linux drive (sdb1) to backup drive (sdc1)...right?
Ex 2 would back up my home dir on sdb1 to backup dribe sdc1...right?
now, will you please tell me what "-av" and "--delete-after" mean and do? I tried to look at the man entry for rsync, it syas -v menas verbose, but most of the time I don't understand man very well. Actually, lately I've been thinking maybe I'm too stupid to use Linux.
I feel strange asking all these ultra basic questions...I have gone from understanding how to do almost anything in Win to understanding almost nothing in Linux. I am very thankful the Linux community is so forthcoming with help, I would be totally lost without you.
Thanks again for your help
it seems you are trying to backup partitions/ drives. mite i suggest dd .
Hello, i see you got your backup running, but wouldn't hurt if you see Backuppc, its a perl web based backup system wich i like, to be honest it's the only backup system i tried, but if it is not broken, don't fix it . This software allows to backup different machines even windows ones.
rweaver:... although I am still curious what the "--delete-after" part does...I sure would like to know that. The man page is uncomprehensible.
My sympathies on the man page, they take a little getting used to. What follows is based on my experience reading them & NOT on any actual use of rsync.
From the rsync man page, emphasis added:
Code:
--del an alias for --delete-during
--delete delete extraneous files from dest dirs
--delete-before receiver deletes before transfer (default)
--delete-during receiver deletes during xfer, not before
--delete-after receiver deletes after transfer, not before
These 5 "--delete" options are about cleaning up your back up -- removing extraneous files from the destination directories. There are 3 "-WHEN" sub-options, in order of increasing safety:
--delete-before
--delete-during
--delete-after
Rather than write my own possibly incorrect explanation, I'll quote from later in the man page:
Quote:
--delete
This tells rsync to delete extraneous files from the receiving side (ones that aren't on the sending side), but only for the directories that are being synchronized. You must have asked rsync to send the whole directory (e.g. "dir" or "dir/") without using a wildcard for the directory's contents (e.g. "dir/*") since the wildcard is expanded by the shell and rsync thus gets a request to transfer individual files, not the files' parent directory. Files that are excluded from transfer are also excluded from being deleted unless you use the --delete-excluded option or mark the rules as only matching on the sending side (see the include/exclude modifiers in the FILTER RULES section).
Prior to rsync 2.6.7, this option would have no effect unless --recursive was in effect. Beginning with 2.6.7, deletions will also occur when --dirs (-d) is in effect, but only for directories whose contents are being copied.
This option can be dangerous if used incorrectly! It is a very good idea to run first using the --dry-run option (-n) to see what files would be deleted to make sure important files aren't listed.
If the sending side detects any I/O errors, then the deletion of any files at the destination will be automatically disabled. This is to prevent temporary filesystem failures (such as NFS errors) on the sending side causing a massive deletion of files on the destination. You can override this with the --ignore-errors option.
The --delete option may be combined with one of the --delete-WHEN options without conflict, as well as --delete-excluded. However, if none of the --delete-WHEN options are specified, rsync will currently choose the --delete-before algorithm. A future version may change this to choose the --delete-during algorithm. See also --delete-after.
--delete-before
Request that the file-deletions on the receiving side be done before the transfer starts. This is the default if --delete or --delete-excluded is specified without one of the --delete-WHEN options. See --delete (which is implied) for more details on file-deletion.
Deleting before the transfer is helpful if the filesystem is tight for space and removing extraneous files would help to make the transfer possible. However, it does introduce a delay before the start of the transfer, and this delay might cause the transfer to timeout (if --timeout was specified).
--delete-during, --del
Request that the file-deletions on the receiving side be done incrementally as the transfer happens. This is a faster method than choosing the before- or after-transfer algorithm, but it is only supported beginning with rsync version 2.6.4. See --delete (which is implied) for more details on file-deletion.
--delete-after
Request that the file-deletions on the receiving side be done after the transfer has completed. This is useful if you are sending new per-directory merge files as a part of the transfer and you want their exclusions to take effect for the delete phase of the current transfer. See --delete (which is implied) for more details on file-deletion.
Sorry for such a long quotation, but it puts what I think is the relevant portion of the man page right here. Feel free to ask about specific pieces that don't make sense to you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.