View previous topic :: View next topic |
Author |
Message |
orange_juice Guru
Joined: 16 Feb 2006 Posts: 588 Location: Athens - Greece
|
Posted: Fri Aug 11, 2006 3:31 pm Post subject: Md5 comparison and rsync issues [solved] |
|
|
Hallo,
I need to copy through ssh a tarball file and I need to verify that the copied file is not corrupted.
During gentoo installation, this could be verified by copying the DIGESTS file and comparing it with the md5sum -c command.
How can I create a DIGESTS file for my tarball in order to do the same thing?
Kind regards,
orange_juice
Last edited by orange_juice on Mon Aug 14, 2006 9:04 pm; edited 4 times in total |
|
Back to top |
|
|
thewally l33t
Joined: 12 May 2005 Posts: 703 Location: Genova
|
Posted: Fri Aug 11, 2006 3:42 pm Post subject: |
|
|
Code: | md5sum myfile > myfile.md5 | _________________ Proudly Member of GeCHI |
|
Back to top |
|
|
orange_juice Guru
Joined: 16 Feb 2006 Posts: 588 Location: Athens - Greece
|
Posted: Fri Aug 11, 2006 3:59 pm Post subject: |
|
|
Great!
Thank you.
Kind regards,
orange_juice |
|
Back to top |
|
|
limn l33t
Joined: 13 May 2005 Posts: 997
|
Posted: Fri Aug 11, 2006 4:09 pm Post subject: |
|
|
rsync has this sort of verification built in. |
|
Back to top |
|
|
orange_juice Guru
Joined: 16 Feb 2006 Posts: 588 Location: Athens - Greece
|
Posted: Fri Aug 11, 2006 6:07 pm Post subject: |
|
|
limn wrote: | rsync has this sort of verification built in. | Thank you for this advice. I can use rsync over ssh, as I saw in the man pages.
Seems to be a more complicated procedure.
I intend to use it for the need of backing up certain directories of a remote box daily. Is this indeed the right tool to do the job? |
|
Back to top |
|
|
limn l33t
Joined: 13 May 2005 Posts: 997
|
Posted: Fri Aug 11, 2006 6:31 pm Post subject: |
|
|
rsync uses ssh by default, since some time.
It is well suited for this backing up - synchronizing.
Not so complicated as automating the making of md5sums for each file and comparing them. |
|
Back to top |
|
|
orange_juice Guru
Joined: 16 Feb 2006 Posts: 588 Location: Athens - Greece
|
Posted: Sat Aug 12, 2006 11:03 am Post subject: |
|
|
Seems to be a very good solution, thank you.
Kind regards,
orange_juice |
|
Back to top |
|
|
orange_juice Guru
Joined: 16 Feb 2006 Posts: 588 Location: Athens - Greece
|
Posted: Mon Aug 14, 2006 2:27 pm Post subject: |
|
|
... another question...
I am currently using Code: | find bin boot etc home lib opt root sbin usr var -depth -print0 | cpio -pmdv --null /<destination directory> | to backup my gentoo system.
Do you think I can use Code: | rsync -RavH /bin /boot /etc /home /lib /opt /root /sbin /usr /var host:/<destination directory> | to backup a remote Gentoo system effectively?
Kind regards,
orange_juice |
|
Back to top |
|
|
limn l33t
Joined: 13 May 2005 Posts: 997
|
Posted: Mon Aug 14, 2006 3:33 pm Post subject: |
|
|
In your command above the -R option is not needed, though it does no harm. If your line were:
Code: | rsync -RavH /usr/share/zoneinfo host:/<destination directory> |
you would want it to preserve usr/share in the destination directory.
You may want to test with the -H and without. There are hard links in, for example, the zoneinfo directory, but they are small files. The overhead of -H may be more than it is worth.
Having said that, it would appear that you are thinking of doing this as root. While there are ways of reducing the risk involved with allowing root to ssh into a box, you may want to consider staying with your original tar file idea, and then use rsync to transfer the tar file as a non-root user. |
|
Back to top |
|
|
orange_juice Guru
Joined: 16 Feb 2006 Posts: 588 Location: Athens - Greece
|
Posted: Mon Aug 14, 2006 6:17 pm Post subject: |
|
|
limn, thank you for your detailed feedback.
The policy I will try to follow is to replace cpio with rsync for backing up my data due to its capability of verifying the data copied and deleting the data that do not exist anymore. I intend to use it mainly for backing up data on the same computer and then tar and save them on another computer where I keep backups.
There is only one box, my brother's computer that is on the same safe network with my desktop, that does not have enough space to backup the data and I intend to use rsync over ssh as root for this only purpose.
-R seems to be useful for the purpose I need it since my intention is to make a mirror tarball of the structure of the existing filesystem to the destination directory. So when I need to restore it, I just do a
I can understand that rsync handles backing up of simple files very well and my worry is whether it can handle the structure of the gentoo system as a whole. This is why I added -H to my options just to be sure that I will not encounter any problems when I need to restore the system. I will try both ways in depth of time and leave experience guide me to the most effective option.
The good news are that I apparently did not ommit any crucial option! (except for --delete, if needed). Going through the man pages I met quite a lot of advanced options and some of them were beyond the level of my gentoo skills! This is why I asked again.
I appreciate your help.
Kind regards,
orange_juice |
|
Back to top |
|
|
limn l33t
Joined: 13 May 2005 Posts: 997
|
Posted: Mon Aug 14, 2006 8:14 pm Post subject: |
|
|
orange_juice wrote: | whether it can handle the structure of the gentoo system as a whole. |
I have used rsync to migrate from a smaller partition to larger one, and from a smaller drive to a larger one, without problem.
Using the -avH options. |
|
Back to top |
|
|
orange_juice Guru
Joined: 16 Feb 2006 Posts: 588 Location: Athens - Greece
|
Posted: Mon Aug 14, 2006 9:03 pm Post subject: |
|
|
Thank you very much.
Kind regards,
orange_juice |
|
Back to top |
|
|
|