Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Md5 comparison and rsync issues [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Fri Aug 11, 2006 3:31 pm    Post subject: Md5 comparison and rsync issues [solved] Reply with quote

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
View user's profile Send private message
thewally
l33t
l33t


Joined: 12 May 2005
Posts: 703
Location: Genova

PostPosted: Fri Aug 11, 2006 3:42 pm    Post subject: Reply with quote

Code:
md5sum myfile > myfile.md5
:wink:
_________________
Proudly Member of GeCHI
Back to top
View user's profile Send private message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Fri Aug 11, 2006 3:59 pm    Post subject: Reply with quote

Great!

Thank you.

Kind regards,
orange_juice
Back to top
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 997

PostPosted: Fri Aug 11, 2006 4:09 pm    Post subject: Reply with quote

rsync has this sort of verification built in.
Back to top
View user's profile Send private message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Fri Aug 11, 2006 6:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 997

PostPosted: Fri Aug 11, 2006 6:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Sat Aug 12, 2006 11:03 am    Post subject: Reply with quote

Seems to be a very good solution, thank you.

Kind regards,
orange_juice
Back to top
View user's profile Send private message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Mon Aug 14, 2006 2:27 pm    Post subject: Reply with quote

... 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
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 997

PostPosted: Mon Aug 14, 2006 3:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Mon Aug 14, 2006 6:17 pm    Post subject: Reply with quote

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
Code:
tar -xvjpf

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
View user's profile Send private message
limn
l33t
l33t


Joined: 13 May 2005
Posts: 997

PostPosted: Mon Aug 14, 2006 8:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Mon Aug 14, 2006 9:03 pm    Post subject: Reply with quote

Thank you very much.

Kind regards,
orange_juice
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum