Script to check MD5SUM on file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to check MD5SUM on file
# 1  
Old 10-16-2010
Script to check MD5SUM of file

Hi,

I currently have a shell script that takes an RPM and scp's it to a set of remote servers and installs it.

What I would like to be able to do is make the script get the md5sum of the RPM locally (so get the md5sum of the rpm from where im running the script) and then scp the rpm to the remote server, and then check the md5sum again, to ensure they match.

If the md5sums match, then continue, if they dont, cancel.

Anyone offer any pointers on how I can do this? Or an example script which I can ammend?

Thank you,

Tom

Last edited by tb1986; 10-16-2010 at 09:02 PM.. Reason: typo
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[md5sum] script

I am getting No such file or directory if my variable contains white spaces... Is there a way to fix this? This works x="1.md5" md5sum -c "$x" This, does not x="23\ 5\ 6\ 7\ 8\ 9\ 10.md5" md5sum -c "$x" md5sum: '23\ 5\ 6\ 7\ 8\ 9\ 10.md5': No such file or directory How do I fix... (1 Reply)
Discussion started by: soichiro
1 Replies

2. Shell Programming and Scripting

Making a script to copy files not seen before (using md5sum)

Hello, I would like to make a script that searches through a SRC folder and copies only files it's never seen before to a DEST folder. SRC = /user/.phonesync/photos-backup DST = /usr/.phonesync/photos-new So basically, I'd start with a: md5sum /user/.phonesync/photos-backup/* >... (29 Replies)
Discussion started by: nbsparks
29 Replies

3. Shell Programming and Scripting

Md5sum script

Hello, I need to download multiple files from an FTP server but occasionally they arrive in error so I need to perform an integrity check. I've been attempting to write a bash script that does the following: Downloads all files including those in sub directories Perform md5sum using... (4 Replies)
Discussion started by: shadyuk
4 Replies

4. Shell Programming and Scripting

md5sum on a file with backslash in its name

Hi there, I found something very weird! Should I report that as a bug or is it me misusing the command? I've got a file with a backslash in its name. I know it's a horrible policy but it's not me. The file came from a mac computer because this is a backup server. Anyway, when using... (8 Replies)
Discussion started by: chebarbudo
8 Replies

5. Shell Programming and Scripting

Using md5sum to name file based on URL

I am trying to download a file and make the filename of the file be the md5sum of the URL. I know to use wgets to download the file but I do not know how to do the rest...any help would be appreciated. (2 Replies)
Discussion started by: The undertaker
2 Replies

6. Shell Programming and Scripting

Duplicate file remover using md5sum--good enough?

This is not a typical question. I have a fully working script but I'm interested in optimizing it. I frequently back up photos and movies from my digital camera and cell phone to both my home/work desktops, laptops, wife's netbook, and my home NAS and often end up with multiple versions of the... (2 Replies)
Discussion started by: Michael Stora
2 Replies

7. Shell Programming and Scripting

Restart script based on MD5sum

Ok, I run a small script, that restarts a perl script when it fails (it's a very unreliable perl script, but I can't change it, it's crucial, and I don't know perl) It outputs data into a logfile. Unfortunately, it also regularly hangs. This is a major problem because if it hangs, no data is... (6 Replies)
Discussion started by: Bakes
6 Replies

8. Shell Programming and Scripting

recursive md5sum check

so I have within my script a little md5sum check... find . ! -type d -print0 | xargs -0 md5sum And I want it to compare the generated values against a file so I'm trying... find . ! -type d -print0 | xargs -0 md5sum -c files.md5 I generated this file by redirecting the output of the... (2 Replies)
Discussion started by: blowFish@ubuntu
2 Replies

9. UNIX for Dummies Questions & Answers

Script to check for a file, check for 2hrs. then quit

I wish to seach a Dir for a specific file, once the file is found i will perform additional logic. If the file is not found within two hours, i would like to exit. Logically, I'm looking for the best way to approach this Thanks for any assistance in advance. Note: I'm using a C shell and... (2 Replies)
Discussion started by: mmarsh
2 Replies

10. UNIX for Dummies Questions & Answers

the file: MD5SUM

i downloaded a Linux distribution from a FTP site today, and i found there is a file named MD5SUM in the same directory, with the following contents: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 c9a4d963a49e384e10dec9c2bd49ad73 valhalla-SRPMS-disc1.iso 41b03d068e84d2a17147aa27e704f79b ... (1 Reply)
Discussion started by: samprax
1 Replies
Login or Register to Ask a Question
GRID-CA-PACKAGE(1)						  Globus Commands						GRID-CA-PACKAGE(1)

NAME
grid-ca-package - Prepare a CA certificate, configuration, and policy for distribution SYNOPSIS
grid-ca-package [-help] [-h] [-usage] [-version] [-versions] grid-ca-package [-ca HASH] [-g] [-b] [-r] [-d] DESCRIPTION
The grid-ca-package utility creates a tarball containing an RPM spec file and the files needed to use a CA with grid tools. It optionally will also create a GPT package for distributing a CA. By default, the grid-ca-package utility displays a list of installed grid CA and prompts for which CA to package. It then creates a tarball containing the CA certificate, signing policy, CA configuration files, and an spec script to generate a binary RPM package containing the CA. If the CA hash is known prior to running grid-ca-package, it may provided as an argument to the -ca parameter to avoid prompting. In addition to generating a spec script and tarball, grid-ca-package creates a GPT package if either the -g or -b options are used on the command-line. These packages may be used to distribute a CA and configuration to systems which do not support RPM packages. The grid-ca-package utility writes the package tarballs to the current working directory. The full set of command-line options to grid-ca-package follows. -help, -h, -usage Display the command-line options to grid-ca-package and exit. -version, -versions Display the version number of the grid-ca-package command. The second form includes more details. -ca CA Use the CA whose name matches the hash string CA. When invoked with this option, grid-ca-package runs non-interactively. -g Create a GPT binary package in addition to the RPM script tarball. This package may be installed on other systems using the gpt-install program. -b Create a GPT binary package with GPT metadata located in the path expected by GPT 3.2 (used in Globus 2.0.0-5.0.x) instead of ${datadir}/globus/packages as used in Globus 5.2.x. This option overrides the -g command-line option. -r Create a binary RPM package for the CA. This option currently only works on RPM-based distributions. -d Create a binary Debian package for the CA. This option currently only works on Debian-based distributions. EXAMPLES
Package a Simple CA with hash 0146c503 % grid-ca-package -ca 0146c503 Creating RPM source tarball... done globus_simple_ca_0146c503.tar.gz ENVIRONMENT VARIABLES
The following environment variables affect the execution of grid-ca-package: GLOBUS_LOCATION Non-standard installation path of the Globus toolkit. SEE ALSO
grid-cert-request(1), grid-ca-sign(1), grid-default-ca(1), grid-ca-create(1) AUTHOR
University of Chicago Globus Toolkit 5.2.0 07/22/2011 GRID-CA-PACKAGE(1)