I think there should be no problem, as your script can simply attach itself to tars output. There come some problems with that, too, as your download cannot be resumed, but I guess you can live with that. Here is some code how I would try it - I've never done this myself, so a look into perlipc could maybe help you a bit more.
$blocksize = 4096;
open( BACKUP, "tar cz $directory |" ) or die "can't fork tar: $!\n";
binmode BACKUP; # just to be on the safe side
do {
$read = read( BACKUP, $data, $blocksize ) or die "can't read: $!\n
+";
if ($read) {
print $data;
};
} while $read;
close BACKUP;
As with your second problem, the "wrong" filename, you can either instruct your webserver to treat your script as a directory and everything following the script name as a parameter to your script (look in the Apache documentation, as it's been a long time since I did this, I guess under SCRIPTEXEC), and issue a redirect from your script (if called without parameters) to an URL with the parameters :
http://invalid.com/cgi-bin/backup.cgi
-> http://invalid.com/cgi-bin/backup.cgi/backup.tar.gz
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|