Hallo Leute,
möchte gerne regelmäßig ein backup meines webspaces machen.
hab dazu ein script gefunden welches die Daten auf dem Webspeicherplatz mit tar gzip packt.
Dummerweise habe ich aber keinen Zugriff auf gzip + tar
der Provider hat diese progs gesperrt und schaltet diese auch nicht frei.
zip kann ich jedoch nutzen :-)
Hat jemand eine Idee wie man das folgende backupscript so umbaut,
dass es nicht tar und gzip, sondern zip verwendet ??
Danke für Eure Hilfe
Gruss
wolli
Hier der Code
#!/usr/local/bin/perl
$version = '1.0';
#########################################################################################
GZ-SITE v1.0 (beta)
# #
GZ-SITE is a web based cgi-script that backs up your web directory into a
gzip. This gzip can either be downloaded and read (in Windows) by WinZip
6.0+, or the file can be left on the server and ungzipped (hopefully in
later versions of GZ-SITE.
# #
# #
# Requirement: Hypermart: #
# #
- Unix server BSDI
- perl 4/5 support 4 and 5
- command line tar /bin/tar
- command line gzip /usr/contrib/bin/gzip
# #
# #
Installation:
# #
1. Make a directory (maybe named backup) and chmod it to 777.
2. Configure the following (Hypermart is pre-configured .. other than home
# directories): #
location of tar
$tar_loc = '/bin/tar';
location of gzip
$gzip_loc = '/usr/contrib/bin/gzip';
directory you want compressed (NO trailing slash!)
$dir = '/data1/hypermart.net/yourname';
the output gzip filename (a common UNIX entention is *.tar.gz)
$output = '/data1/hypermart.net/yourname/a_dir_chmoded_to_777/yourname-bk.tar.gz';
the www foutput of the output file (should be same filename/directory as above)
$htmlout = 'http://yourname.hypermart.net/a_dir_chmoded_to_777/yourname-bk.tar.gz';
the temporary tar file (this will be deleted)
$tar_temp = '/data1/hypermart.net/htmlcrawler/a_dir_chmoded_to_777/bk.tar';
3. Upload this file and chmod it to 755.
4. Execute it via web.
5. The html output will tell you what files were gzipped and where you can
# download them. #
# #
# #
(c) SkidCo/Josh Skidmore 1998-99
skidmore@musc.edu
http://skidmore.hypermart.net/scripts/cgi/gz-site/
# #
#########################################################################################
DO NOT EDIT BELOW ... MIS-EDITS COULD CAUSE SERVER PROBLEMS!!!!!
print qq!Content-type: text/html
<html>
<head>
<title>site compression</title>
</head>
<body>
<blockquote>
<font size="2" face="arial"><b>gz-site $version</b></font><br><br>
!;
delete previous backups
unlink("$output");
open(TAR, "$tar_loc cf $tar_temp $dir/* |");
print qq!<font size="2 face="arial"><b>1.</b>wrote tar file [ </font>
<font size="1" face="arial">$tar_temp</font>
<font size="2 face="arial"> ]</font>
!;
close(TAR);
print qq!<form>
<font size="2 face="arial"><b>2.</b> test tar file [ </font>
<font size="1" face="arial">$tar_temp</font>
<font size="2 face="arial"> ] : </font><br>
<select name="">
!;
open (EXE, "$tar_loc tf $tar_temp |");
@data=<EXE>;
close(EXE);
foreach $file (@data)
{
print "<option value="">$file<option>\n";
}
open(GZ, "$gzip_loc -c $tar_temp > $output |");
print qq! </select><br><br>
<font size="2 face="arial"><b>3.</b> wrote gzip [ </font>
<font size="1" face="arial">$output</font>
<font size="2 face="arial"> ]</font><br><br>!;
close(GZ);
unlink("$tar_temp");
print qq!<font size="2 face="arial"><b>4.</b> delete temp tar file [ </font>
<font size="1" face="arial">$tar_temp</font>
<font size="2 face="arial"> ]</font><br><br>!;
print qq!<font size="2 face="arial"><b>5.</b> download gzip file [ </font>
<font size="1" face="arial"><a href="$htmlout">$htmlout</a></font>
<font size="2 face="arial"> ]</font><br>!;
print qq!
<br><br>
<center><font size="1" face="arial,veranda">
<a href="http://skidmore.hypermart.net/scripts/cgi/gz-site/">gz-site</a> $version -- (c) skidco, 1999
</font></center>
</body>
</html>!;