soheil has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ct +ime,$blksize,$block); my $command1 = "tar cvf backup.tar members templates reviews"; system($command1); ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime +,$blksize,$block) = stat "backup.tar"; my $DAT_SIZE = $size; print "Content-Type: text/html\n\n"; if (-e "backup.tar") { print "<CENTER><H1>Backup complete.</H1></CENTER><BLOCKQUOTE>< +BLOCKQUOTE>\n"; print "<H4>We recommend that you download the <BLOCKQUOTE><A H +REF=\"backup.tar\">Data Backup File ($DAT_SIZE Bytes)</A></BLOCKQUOTE +>to your local computer for safe keeping...</H4>\n"; print "</CENTER><BLOCKQUOTE>Note: The backup file (backup.tar) + is in the same directory as your CGI Programs Data. It is possible +that you may not be able to download it using the link above (.cgi-bi +n directories will not allow downloads from them). If you cannot dow +nload it with the provided link, we recommend that you FTP into your +server and retreive the file manually.</BLOCKQUOTE></BLOCKQUOTE>\n"; } else { print "<CENTER><H1>Data could not be backed up.</H1>\n"; print "<H4>Exited with the following message: $!</H4>\n"; } exit 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: running tar from a browser
by sschneid (Deacon) on Jul 18, 2002 at 18:41 UTC | |
|
Re: running tar from a browser
by DamnDirtyApe (Curate) on Jul 18, 2002 at 20:05 UTC | |
|
•Re: running tar from a browser
by merlyn (Sage) on Jul 18, 2002 at 21:25 UTC |