Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Links Database suddenly empty

Quote Reply
Links Database suddenly empty
Hi,
my Links database is suddenly empty (0 bytes)
It happened overnight. What could it caused and how can I fix and build my base again?

Thanks in advance
Quote Reply
Re: Links Database suddenly empty In reply to
The big problem is : I HAVE password protected the admin area with a quite sure password and the backup files are also empty !!!!!


(GD AND WHO_I_AM are the same personna!)

Chris
Quote Reply
Re: Links Database suddenly empty In reply to
I would check to make sure no one has accessed the admin. A poor/non-existant password is sometimes the culprit.

As for restoring, if you look in the backup directory, get your most recent backup file and copy it over to the data directory and rename it links.db.

Hope that helps,

Alex
Quote Reply
Re: Links Database suddenly empty In reply to
Well, since both your main database file and backup file are both empty, that leads me to believe that you have been attacked by a hacker. Do you have any backups of your datbase? If not, then you have just lost your database. Sorry.

I would recommend changing your username and password for your web account, and also the passwords for your Web applications ASAP!

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
Quote Reply
Re: Links Database suddenly empty In reply to
But links.db is a flat ascii file isn't it?`

I do still have all the unchanged HTML pages, so why couldn't I made a new links.db in Notepad and just type in the current data using the delimter. Isn't that possible???? Really??? odd.
Quote Reply
Re: Links Database suddenly empty In reply to
OK; but can't I manually re-build the database file? What'S the structure of the .db file? Never looked at it before.

For the future I will let send the file to me every day via crontab and php3
Quote Reply
Re: Links Database suddenly empty In reply to
Who_am_I , or GreatDragon.


Evertime you "build all" you should be checking your "links.db" file located in the data directory.

When you're sure the links you added were added, you should be backing up a copy on your computers hard drive, even if links provides a back up.

This way if it happens again, all you have to do is up load your copy of the data directory (located on your computers hard drive :-))back up to your server and do a "build all", and all your links will once again appear.

Gerardo

Quote Reply
Re: Links Database suddenly empty In reply to
Well, if your links.db and back-up file are both empty and you have no other backup copies of your links.db, then you are screwed. Sorry. You need the links.db file to re-build your index.

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
Quote Reply
Re: Links Database suddenly empty In reply to
YES, you can manually restore your database file using Notepad with the delimiters in the right spots. However, I would suggest using Excel or Access. This is also a good method of keeping an off-line copy of your database.

You could also install Ximati Web Server or another web server software package for your operating system locally and build your database on your PC and then upload the database file when you need to.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Links Database suddenly empty In reply to
I'm joining this conversation a bit late, but...

When I was early in the process of building up my Links database, I had a similar problem. During a build (can't remember if it was staggered or build all, but it's in one of these threads from around four months ago), the database was corrupted and became zero bytes. I'm not sure about the backup, but I think that might have been overwritten with the zero byte file as well. Fortunately, I had a downloaded database and I only lost about 50 records since that version. Thus, I heartily encourage you to follow gerardo's advice. Always have a downloaded backup that is fairly recent.

Dan
Quote Reply
Re: Links Database suddenly empty In reply to
I would also recommend using a mailer script like the one that Pasha wrote that can send you the file periodically. Then the links.db will be in your mail directory as well, which is quite secure.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Links Database suddenly empty In reply to
Who's Pasha?
And where is this mailer script??

Thanks,
Adrian
Quote Reply
Re: Links Database suddenly empty In reply to
Search the CGI/Perl Forum for the User "Pasha1" or "Pasha" and you will find Threads where he has been active. I don't remember his URL off-hand, but he has a file copy/deletion script that may help you.

Hope this helps.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




[This message has been edited by Eliot (edited November 01, 1999).]
Quote Reply
Re: Links Database suddenly empty In reply to
I found Pasha's web site:

http://www.cellwarp.com

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Links Database suddenly empty In reply to
Hi,
I have searched Pasha's site and this forum, but have not been able to find the specific scritp you are referring to.
Would anyone have an url to the script?
Thanks,
-V
Quote Reply
Re: Links Database suddenly empty In reply to
Search the Perl/CGI Forum in this site...Pasha has kindly posted the script in a Thread in that forum!

Wink

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Links Database suddenly empty In reply to
OK,
I have searched the perl/cgi forum using the name pasha, separately and in combination with every term I could think of including links.db, email, back up, copy, deletion, etc etc, but it has not pulled up anything recognizable as what is mentioned in this thread. Either I get so many listings that it maxes out at 50, with nothing in the list seeming relevant... or I get a short list of threads which also do not have any bearing on the issue.
Do I need search engine remedial skills training or....?
Clues?
Thanks,
-V
Quote Reply
Re: Links Database suddenly empty In reply to
Found the Thread (first try with only two results). Frown

Here it is:

http://www.gossamer-threads.com/scripts/forum/resources/Forum8/HTML/000765.html

Quote:
Do I need search engine remedial skills training or....?

Sure looks like it.

Wink

Regards,


------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Links Database suddenly empty In reply to
deleted duplicate post...browser error
-V

[This message has been edited by V Silly (edited November 07, 1999).]
Quote Reply
Re: Links Database suddenly empty In reply to
The script I was looking for is the one referred to below:
================================
I would also recommend using a mailer script like the one that Pasha
wrote that can send you the file periodically. Then the links.db will be
in your mail directory as well, which is quite secure.
===============================
The link to the thread above is about a script to delete files.
2 different things, no?
?????
-V

[This message has been edited by V Silly (edited November 07, 1999).]
Quote Reply
Re: Links Database suddenly empty In reply to
Alright, first of all: I don't know anything of perl at all, but I gave it a shot, and I have now my url-, email- and links database emailed to me, via the links manager.

I hope this works for you too. You can copy the code here ( www.peng.nl/backup_pl.txt ) or copy it from this page.

Let me know if I've done stupid things!

If you like it, let me know as well. (it's my very first attempt).

Lex.

------------------------------------------

#!/usr/bin/perl
#
#
# ** File Backupper 1 **
# by Lex Thoonen
# Lex@peng.nl
# http://www.peng.nl
#
# (if you wonder why 'peng', it's all explained at the website)
#
# Okay, here we go, this is my first attempt ever with perl...
# But hey, it worked at my site!
# I've put this file in my (protected) 'admin' directory
# and I think, if you have 'links' normally installed, you
# probably won't have to change the filenames and paths.
# but check them anyway.
#
# Save this file as 'backup.pl' at your admin directory (links)
# Replace the emailto and emailfrom and mailprog if necessary
#
# I'm sorry if I can't give you more options here, to be honest,
# I just don't know anything of perl.
# You probably know as much as I do (or more)
#
# By the way, this 'program' backups the links database, email and url.
#
# If you improve or alter this, please let me know!
# I could probably do with it myself...
#
# p.s. Thanks to everybody who ever put their code available
# (for me to look at)
#
# To make this backupper available from your 'links administration menu'
# it's easiest to open up 'admin_html.pl' and add the following lines
# at 'sub html_navigation' (I've put it as the last one)
#
# <p><$font><b>Back Up by Email</b><br></font>
# <$font>
# <a href="backup.pl">Send now</a><br>
# </font>
#
#

$file1 = "data/email.db";
$file2 = "data/links.db";
$file3 = "data/url.db";
$emailto = "lex\@peng.nl"; # leave the '\' in front of the '@'!
$emailfrom = "backupper\@yoursite.com";
$mailprog = "/usr/bin/sendmail";

#
#

print "Content-type: text/plain\n\n";
print "So, \n\nyou wanted a back up right?...\ncoming!\n\n";

open(emaillist, "$file1");
@entries1 = <emaillist>;
open(linkslist, "$file2");
@entries2 = <linkslist>;
open(urllist, "$file3");
@entries3 = <urllist>;
open(MAIL,"|$mailprog -t");
print MAIL "To: $emailto\n";
print MAIL "From: $emailfrom\n";
print MAIL "Subject: backup of $file1, $file2 and $file3";
print MAIL "\n\n\nHi,\n\nYour backups of today:...\n\n";
print MAIL "**************************************\n\n$file1\n\n";
print MAIL "\n\n";
foreach $line (@entries1) {
print MAIL "$line";
}
print MAIL "\n\n";
print MAIL "**************************************\n\n$file2\n\n";
print MAIL "\n\n";
foreach $line (@entries2) {
print MAIL "$line";
}
print MAIL "\n\n";
print MAIL "**************************************\n\n$file3\n\n";
print MAIL "\n\n";
foreach $line (@entries3) {
print MAIL "$line";
}
print MAIL "\n\n**************************************\n\n";
print MAIL "And now be careful with them!\n\nLex.\n(lex\@peng.nl)";
close (MAIL);
close emaillist;
close linkslist;
close urllist;

#
#


print "***************************************\n\nReady! \n\nYou should have: \n\n$file1, \n$file2 and \n$file3 \n\nat your mailbox. \n\nIt all has been sent to: $emailto ";
print "\n\nLex.\n(comments: lex\@peng.nl)";


####################

That was it!

[This message has been edited by Lex (edited December 12, 1999).]