/
usr
/
local
/
bin
/
/usr/local/bin
mkdir
upload
Name
Size
Mode
Actions
config_data
7138
0555
edit
dl
rm
crc32
1043
0555
edit
dl
rm
crontab
3320736
0755
edit
dl
rm
drush
6138646
0755
edit
dl
rm
drush.phar
6138646
0755
edit
dl
rm
ea-php72
5815400
0755
edit
dl
rm
ea-php73
5647288
0755
edit
dl
rm
ea-php74
6383296
0755
edit
dl
rm
ea-php80
7986080
0755
edit
dl
rm
ea-php81
8098952
0755
edit
dl
rm
ea_convert_php_ini
40811
0755
edit
dl
rm
ea_current_to_profile
11519
0755
edit
dl
rm
ea_install_profile
7274
0755
edit
dl
rm
ea_sync_user_phpini_settings
6888
0755
edit
dl
rm
htmltree
1173
0555
edit
dl
rm
instmodsh
4194
0555
edit
dl
rm
ipcount
3724
0555
edit
dl
rm
iptab
982
0555
edit
dl
rm
json_pp
3828
0555
edit
dl
rm
json_xs
7013
0555
edit
dl
rm
lsphp
937
0755
edit
dl
rm
lwp-download
8635
0555
edit
dl
rm
lwp-dump
2797
0555
edit
dl
rm
lwp-mirror
2478
0555
edit
dl
rm
lwp-request
15059
0555
edit
dl
rm
mech-dump
4623
0555
edit
dl
rm
passwd
3768664
0755
edit
dl
rm
pear
935
0755
edit
dl
rm
php
933
0755
edit
dl
rm
php-config
6384
0755
edit
dl
rm
prove
13457
0555
edit
dl
rm
ptar
3456
0555
edit
dl
rm
ptardiff
2535
0555
edit
dl
rm
ptargrep
4299
0555
edit
dl
rm
shasum
9287
0555
edit
dl
rm
tpage
8923
0555
edit
dl
rm
ttree
39234
0555
edit
dl
rm
wp
6928461
0755
edit
dl
rm
wp-cli.phar
6928461
0755
edit
dl
rm
zipdetails
48366
0555
edit
dl
rm
Edit:
/usr/local/bin/lwp-mirror
(2478B)
#!/usr/bin/perl -w eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}' if 0; # not running under some shell # Simple mirror utility using LWP =head1 NAME lwp-mirror - Simple mirror utility =head1 SYNOPSIS lwp-mirror [-v] [-t timeout] <url> <local file> =head1 DESCRIPTION This program can be used to mirror a document from a WWW server. The document is only transferred if the remote copy is newer than the local copy. If the local copy is newer nothing happens. Use the C<-v> option to print the version number of this program. The timeout value specified with the C<-t> option. The timeout value is the time that the program will wait for response from the remote server before it fails. The default unit for the timeout value is seconds. You might append "m" or "h" to the timeout value to make it minutes or hours, respectively. Because this program is implemented using the LWP library, it only supports the protocols that LWP supports. =head1 SEE ALSO L<lwp-request>, L<LWP> =head1 AUTHOR Gisle Aas <gisle@aas.no> =cut use LWP::Simple qw(mirror is_success status_message $ua); use Getopt::Std; use Encode; use Encode::Locale; $progname = $0; $progname =~ s,.*/,,; # use basename only $progname =~ s/\.\w*$//; #strip extension if any $VERSION = "6.15"; $opt_h = undef; # print usage $opt_v = undef; # print version $opt_t = undef; # timeout unless (getopts("hvt:")) { usage(); } if ($opt_v) { require LWP; my $DISTNAME = 'libwww-perl-' . LWP::Version(); die <<"EOT"; This is lwp-mirror version $VERSION ($DISTNAME) Copyright 1995-1999, Gisle Aas. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. EOT } $url = decode(locale => shift) or usage(); $file = encode(locale_fs => decode(locale => shift)) or usage(); usage() if $opt_h or @ARGV; if (defined $opt_t) { $opt_t =~ /^(\d+)([smh])?/; die "$progname: Illegal timeout value!\n" unless defined $1; $timeout = $1; $timeout *= 60 if ($2 eq "m"); $timeout *= 3600 if ($2 eq "h"); $ua->timeout($timeout); } $rc = mirror($url, $file); if ($rc == 304) { print STDERR "$progname: $file is up to date\n" } elsif (!is_success($rc)) { print STDERR "$progname: $rc ", status_message($rc), " ($url)\n"; exit 1; } exit; sub usage { die <<"EOT"; Usage: $progname [-options] <url> <file> -v print version number of program -t <timeout> Set timeout value EOT }
Save
cmd:
run