What you can do to add the
url.db into your backup scheme would be the following:
1) In the
sub build_backup routine in your
nph-build.cgi file, add the following codes:
Code:
&File::Copy::copy ("$db_script_path/data/url.db", "$db_script_pat
h/backup/$date.url.db") or &cgierr ("Unable to copy category backup. Reason
: $!");
BEFORE the following line:
Code:
# Otherwise, the ugly way.
2) Replace the following line:
Code:
print "\tBacking up links, category and email database (Regular - $@) ..
. \n";
with the following:
Code:
print "\tBacking up links, category, email, and url database (Regular - $@) ..
. \n";
3) Replace the following codes:
Code:
foreach (qw!links categories email!) {
with the following codes:
Code:
foreach (qw!links categories email url!) {
So, the complete new sub-routine should look like the following:
Code:
sub build_backup {
# --------------------------------------------------------
# Backs up important database files.
#
my $date = &get_date;
if (-e "$db_script_path/backup/$date.links.db") {
print "\tBackup exists for today.. Skipping\n";
return;
}
# Try to do it the right way..
eval { require File::Copy; };
if (!$@) {
print "\tBacking up links, category and email database (File::Copy) ... \n";
&File::Copy::copy ("$db_script_path/data/links.db", "$db_script_path/backup/$date.links.db") or &cgierr ("Unable to copy links backup. Reason: $!");
&File::Copy::copy ("$db_script_path/data/categories.db", "$db_script_path/backup/$date.category.db") or &cgierr ("Unable to copy category backup. Reason: $!");
&File::Copy::copy ("$db_script_path/data/email.db", "$db_script_path/backup/$date.email.db") or &cgierr ("Unable to copy email backup. Reason: $!");
&File::Copy::copy ("$db_script_path/data/url.db", "$db_script_path/backup/$date.url.db") or &cgierr ("Unable to copy email backup. Reason: $!"); }
# Otherwise, the ugly way.
else {
print "\tBacking up links, category, email, and url database (Regular - $@) ... \n"; foreach (qw!links categories email url!) { open (TMP, "$db_script_path/data/$_.db") or &cgierr ("Unable to open $db_script_path/data/$_.db. Reason: $!");
open (TMPOUT, ">$db_script_path/backup/$date.$_.db") or &cgierr ("Unable to open $db_script_path/$date.$_.db. Reason: $!");
while (<TMP> ) {
print TMPOUT;
}
close TMP;
close TMPOUT;
}
}
}
Hope this helps.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us