File Manager
Upload
Current Directory: /home/lartcid/public_html/journal.lartc.id
[Back]
..
[Open]
Hapus
Rename
.htaccess
[Edit]
Hapus
Rename
.well-known
[Open]
Hapus
Rename
README.md
[Edit]
Hapus
Rename
api
[Open]
Hapus
Rename
cache
[Open]
Hapus
Rename
cgi-bin
[Open]
Hapus
Rename
classes
[Open]
Hapus
Rename
config.TEMPLATE.inc.php
[Edit]
Hapus
Rename
config.inc.php
[Edit]
Hapus
Rename
controllers
[Open]
Hapus
Rename
cypress.json
[Edit]
Hapus
Rename
dbscripts
[Open]
Hapus
Rename
docs
[Open]
Hapus
Rename
error_log
[Edit]
Hapus
Rename
favicon.ico
[Edit]
Hapus
Rename
index.php
[Edit]
Hapus
Rename
js
[Open]
Hapus
Rename
lib
[Open]
Hapus
Rename
locale
[Open]
Hapus
Rename
mini.php
[Edit]
Hapus
Rename
pages
[Open]
Hapus
Rename
php.ini
[Edit]
Hapus
Rename
plugins
[Open]
Hapus
Rename
public
[Open]
Hapus
Rename
registry
[Open]
Hapus
Rename
scheduledTaskLogs
[Open]
Hapus
Rename
schemas
[Open]
Hapus
Rename
styles
[Open]
Hapus
Rename
templates
[Open]
Hapus
Rename
tools
[Open]
Hapus
Rename
Edit File
#!/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.05"; $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 }
Simpan