Displaying part of HTML before and after system() command

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Displaying part of HTML before and after system() command

    Consider my (simplified) code below:

    With my old ISP it used to display "Archiving database images ..." then
    paused for a while (30 secs to a few minutes) then displayed complete".

    With my new ISP it pauses for ages but doesn't go anywhere

    Replacing the system() line with a sleep(5) shows me that it is waiting
    until the whole process is complete before outputting ... but for some
    reason I think this is going wrong as IE just keeps trying to open page ...
    but never does.

    How can I get it back to how it was?

    Many thanks




    set_time_limit(0); // As tar/gzip takes a while
    echo "<P>Archiving database images ... ";
    system ("tar cvf - $imagedir"."/*.* | gzip -r9 >
    $backupfilename".".tar.gz");
    echo "complete\n";




    Aaron Whiffin Guest

  2. Similar Questions and Discussions

    1. Displaying part of an image
      I'm making a board game in Flex. Both to save bandwidth and for convenience in the code, I want to store the bitmaps for all the tiles in a single...
    2. Loading part of the HTML page?
      When you answer a feedback guestion in Google with a radio button, only that section of the page reloads and says "thankyou," not the entire page....
    3. Displaying only a part of a record field
      I would like to output only a part of a record field which is returned by a query. For example the outputed text would look like: "Drawing has...
    4. Running command from string variable as if part of script
      I'm reading another perl script into array and want to commands from the the array as if normal perl commands. How do I do it?
    5. Showing an HTML file in part of a Webform
      Showing an HTML file in part of a Webform Hi I have a Webform with some buttons on the left side of the form. What I want when clicking one of...
  3. #2

    Default Re: Displaying part of HTML before and after system() command

    Aaron Whiffin wrote:
    > With my old ISP it used to display "Archiving database images ..." then
    > paused for a while (30 secs to a few minutes) then displayed complete".
    >
    > With my new ISP it pauses for ages but doesn't go anywhere
    >
    > Replacing the system() line with a sleep(5) shows me that it is waiting
    > until the whole process is complete before outputting ... but for some
    > reason I think this is going wrong as IE just keeps trying to open page
    > ... but never does.
    >
    <snip>
    >
    >
    > set_time_limit(0); // As tar/gzip takes a while
    > echo "<P>Archiving database images ... ";
    print "\n";
    flush();
    > system ("tar cvf - $imagedir"."/*.* | gzip -r9 >
    > $backupfilename".".tar.gz");
    > echo "complete\n";
    A better solution would be to dissociate the backup from the httpd process:

    system ("at now tar -cvzf {$backupfilename}.tar.gz {$imagedir}/*.* | mail -s
    backedup arron@somewhere");

    HTH

    C.

    Colin McKinnon Guest

  4. #3

    Default Re: Displaying part of HTML before and after system() command


    > print "\n";
    > flush();
    Perfect thanks
    > A better solution would be to dissociate the backup from the httpd
    process:
    >
    > system ("at now tar -cvzf {$backupfilename}.tar.gz {$imagedir}/*.* |
    mail -s
    > backedup arron@somewhere");
    File a few hundred Mb - too big to email

    Any other tidy ways of doin this?

    Cheers for your help


    Aaron Whiffin Guest

  5. #4

    Default Re: Displaying part of HTML before and after system() command

    > system ("at now tar -cvzf {$backupfilename}.tar.gz {$imagedir}/*.* |
    mail -s
    > backedup arron@somewhere");
    Can I make system verbose and output it's data to PHP (and hence the screen)
    as it is processed?

    (I'm new to all this)

    Cheers


    Aaron Whiffin Guest

  6. #5

    Default Re: Displaying part of HTML before and after system() command

    > File a few hundred Mb - too big to email
    I get it - the outpu is sent via email ... I'll check it - cheers :o)


    Aaron Whiffin Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139