| Server IP : 208.122.213.31 / Your IP : 216.73.216.45 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/bukkake-mpegs.com/cgi-bin/tgp/utils/ |
Upload File : |
#!/usr/bin/perl
##############################
## AutoGallery Pro v2.0.x ##
#####################################################################
## backup - command line or cron backup tool ##
#####################################################################
use vars qw( $FILE $CDIR %OPTIONS );
$CDIR = '/home/soft/cgi-bin/agp'; ## The full directory path to your AutoGallery Pro Installation
#####################################################################
## Removing the link back to CGI Works is a copyright violation. ##
## Altering or removing any of the code that is responsible, in ##
## any way, for generating that link is strictly forbidden. ##
## Anyone violating the above policy will have their license ##
## terminated on the spot. Do not remove that link - ever. ##
#####################################################################
chdir($CDIR);
require 'agp.pl';
parseArgs();
print "\nBacking up data to $FILE, please wait..." if( $OPTIONS{'-v'} );
backupData($FILE);
print "done\n\n" if( $OPTIONS{'-v'} );
exit;
sub backupData
{
my $file = shift;
fwrite("$DDIR/$file");
my @dirs = qw( banned dbs html icons links mails );
fwrite("$DDIR/$file", "Database: postid\n<<<" . freadline("$DDIR/postid") . ">>>\nDatabase: cheatid\n<<<" . freadline("$DDIR/cheatid") . ">>>\n");
foreach $dir ( @dirs )
{
for( @{ dread("$DDIR/$dir", '^[^.]') } )
{
fappend("$DDIR/$file", "Database: $dir/$_\n<<<");
open(DB, "$DDIR/$dir/$_") || err("$!", "$DDIR/$dir/$_");
flock(DB, $LOCK_EX);
while( <DB> )
{
fappend("$DDIR/$file", $_);
}
fappend("$DDIR/$file", ">>>\n");
flock(DB, $LOCK_UN);
close(DB);
}
}
}
sub parseArgs
{
my %valid = qw( -v 1 );
# Parse out the options
if( $#ARGV != -1 )
{
if( $ARGV[0] eq '--help' )
{
usage();
}
else
{
for( @ARGV )
{
if( index($_, '-') == 0 )
{
if( length($_) > 2 )
{
while( $_ =~ /([a-zA-Z])/g )
{
$OPTIONS{"-$1"} = 1;
}
}
else
{
$OPTIONS{$_} = 1;
}
}
else
{
$FILE = $_;
}
}
}
}
if( !$FILE )
{
$FILE = fdate('%m-%d-%Y') . '.txt' if( !$FILE );
}
for( keys %OPTIONS )
{
if( !$valid{$_} )
{
print "\nInvalid option: $_\n";
usage();
}
}
}
sub usage
{
print "\nusage: backup [OPTIONS] FILE\n\n";
print "Options:\n";
print " -v Verbose mode\n";
print "\n";
print "File:\n";
print " This specifies the filename you want the data to be written to.\n";
print " The backup file will be generated in your data directory. If you\n";
print " do not specify a filename, a file named with the current date will\n";
print " be used. Example: 02-04-2002.txt for February 4th, 2002\n\n";
exit;
}