12-03-2011
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.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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... (0 Replies)
Discussion started by: tb1986
0 Replies
5. Web Development
I am trying to find a way to test some code, but I need to rewrite a specific URL only from a specific HTTP_HOST
The call goes out to
http://SUB.DOMAIN.COM/showAssignment/7bde10b45efdd7a97629ef2fe01f7303/jsmodule/Nevow.Athena
The ID in the middle is always random due to the cookie.
I... (5 Replies)
Discussion started by: EXT3FSCK
5 Replies
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
Hi Friends,
We have a situation where we need to pass API based URL which will return XML response ,and I need to convert those XML response to a delimited flat file.
url.txt -- will have
http://xyz.com/beta/xxx.xml?isDRR=True&city=London&province=England... (1 Reply)
Discussion started by: rakesh5300
1 Replies
8. Web Development
Hello,
I have added following rewrite cond and rewrite rules but it does not work.
RewriteCond %{HTTP_REFERER} ^http://192\.168\.1\.150/categories/.*$
RewriteRule ^(.*)$ http://www.blahblah.com/
When I hit url : http://192.168.1.150/categories/881-Goes?page=7 in my browser - it... (2 Replies)
Discussion started by: ashokvpp
2 Replies
9. Shell Programming and Scripting
Hello,
Am very new to perl , please help me here !!
I need help in reading a URL from command line using PERL:: Mechanize and needs all the contents from the URL to get into a file.
below is the script which i have written so far ,
#!/usr/bin/perl
use LWP::UserAgent;
use... (2 Replies)
Discussion started by: scott_cog
2 Replies
10. Shell Programming and Scripting
Hello.
I'm writing a script where every file you create will generate a md5sum and store it into a text file.
Say I create 2 files, it'll look like this in the text file:
d41d8cd98f00b204e9800998ecf8427e /helloworld/saystheman
d41d8cd98f00b204e9800998ecf8427e /helloworld/test
I... (3 Replies)
Discussion started by: batarangs_
3 Replies
zsync(1) File Transfer zsync(1)
NAME
zsync - Partial/differential file download client over HTTP
SYNTAX
zsync [ -u url ] [ -i inputfile ] [ -o outputfile ] [ { -s | -q } ] [ -k file.zsync ] [ -A hostname=username:password ] { filename | url }
zsync -V
DESCRIPTION
Downloads a file over HTTP. zsync uses a control file to determine whether any blocks in the file are already known to the downloader, and
only downloads the new blocks.
Either a filename or a URL can be given on the command line - this is the path of the control file for the download, which normally has the
name of the actual file to downlaod with .zsync appended. (To create this .zsync file you have to have a copy of the target file, so this
file should be generated by the person providing the download).
zsync downloads to your current directory. It looks for any file in the directory of the same name as the file to download. If it finds
one, it assumes that this is an earlier or incomplete version of the new file to download, and scans this file for any blocks that it can
use to build the target file. (It also looks for a file of the same name with .part appended, so it will automatically find previously
interrupted zsync downloads and reuse the data already downloaded. If you know that the local file to use as input has a different name,
you must use -i)
zsync retrieves the rest of the target file over HTTP. Once the download is finished, the old version (if the new file wants the same name)
is moved aside (a .zs-old extension is appended). The modification time of the file is set to be the same as the remote source file (if
specified in the .zsync).
OPTIONS
-A hostname=username:password
Specifies a username and password to be used with the given hostname. -A can be used multiple times (with different hostnames), in
cases where e.g. the
.zsync file is on a different server from the download, or there are multiple download servers (there could be different auth
details for different servers - and zsync never assumes that your password should be sent to a server other than the one named -
otherwise redirects would be dangerous!).
-i inputfile
Specifies (extra) input files. inputfile is scanned to identify blocks in common with the target file and zsync uses any blocks
found. Can be used multiple times.
-k file.zsync
Indicates that zsync should save the zsync file that it downloads, with the given filename. If that file already exists, then zsync
will make a conditional request to the web server, such that it will only download it again if the server's copy is newer. zsync
will append .part to the filename for storing it while it is downloading, and will only overwrite the main file once the download is
done - and if the download is interrupted, it will resume using the data in the .part file.
-o outputfile
Override the default output file name.
-q Suppress the progress bar, download rate and ETA display.
-s Deprecated synonym for -q.
-u url This specifies the referring URL. If you have a .zsync file locally (if you downloaded it separately, with wget, say) and the
.zsync file contains a relative URL, you need to specify where you got the .zsync file from so that zsync knows which server and
path to use for the rest of the download (this is analogous to adding a <base href="..."> to a downloaded web page to make the links
work).
-V Prints the version of zsync.
FILES
ENVIRONMENT VARIABLES
http_proxy
Should be the [http://]hostname:port for your web proxy, if one is required to access the target web server(s).
EXAMPLES
zsync -i /var/lib/apt/lists/server.debian.org_debian_dists_etch_main_binary-i386_Packages http://zsync.moria.org.uk/s/etch/Packages.zsync
AUTHORS
Colin Phipps <cph@moria.org.uk>
SEE ALSO
zsyncmake(1)
Colin Phipps 0.6.2 zsync(1)