Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Auto download files with time stamp

by Scott7477 (Chaplain)
on Jun 20, 2007 at 17:41 UTC ( [id://622335]=CUFP: print w/replies, xml ) Need Help??

This script is a variation on this script
that adds a GMT time stamp of when each file is retrieved to the file name:
use strict; use LWP::Simple; use POSIX; use File::Basename; #usage timestamp_fileget.pl filename.txt my $filename = shift; open (DATA, $filename) || die "File open failure!"; while (my $downloadurl = <DATA>){ (my $name, my $path, my $suffix) = fileparse($downloadurl); print "\n"; print $downloadurl."\n"; my $timestring = strftime( "%Y%m%d_%H%M%S", gmtime() ); my $savefilename = $timestring.$name.$suffix; print $savefilename."\n"; my $status = getstore($downloadurl,$savefilename); print $status."\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://622335]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 07:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found