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


In reply to Re: Auto-Backup Questions by Corion
in thread Auto-Backup Questions by Zoogie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.