Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 12-23-2004, 03:58 PM   #1
Joe Heng
LQ Newbie
Registered: Dec 2004
Posts: 2

Rep: Reputation: 0
Accidentally Deleted Everything In /var/log

Can some kind soul kindly give me some advice as to what to do? or how to rectify this problem?
I accidentally deleted everything in /var/log
I am still able to boot the system, my services like bind, samba, nfs, squid...etc are all working. Except Apache gives an error unable to find error_log
I have reinstalled swaret, but it doesnt have the cache of all installed packages on my system. Is there anyway I can rebuild that cache?
Old 12-23-2004, 04:06 PM   #2
Registered: Feb 2004
Location: Ottawa, Ontario, Can
Distribution: Slackware, ubuntu
Posts: 391

Rep: Reputation: 32
Hate to say this.. but you should have made backups. That partition isn't even particularily large..
Old 12-23-2004, 04:34 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
I'm not at my home linux computer so I can't check the filename or exact location of the Apache error_log. If this is given in the error message, you could try using the touch command to create an empty one.

The location of the logs may be determined on how Apache was compiled. type in the command:
/usr/local/apache/bin/httpd -V

This should give information such as:
-D HTTPD_ROOT="/usr/local/apache"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"

I don't know what the permissions and ownership of these log files should be. Perhaps someone could provide more information.

If you accidentally delete files, which other programs may be using, you could try locating them using the 'lsof' command. (LiSt Open Files)

Piping the output through grep like: lsof | grep '/var/log'
could give you the numbers of the process which still have a handle on the deleted file. You can then cd to the corresponding process in the /proc directory and copy the file from there.
Old 12-23-2004, 07:20 PM   #4
Joe Heng
LQ Newbie
Registered: Dec 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Smile Thanx jschiwal!

Thanx for ur advice, I managed to get Apache to work again by recreating the /var/log/apache directory and using touch to create an empty error_log file.
Abt my installed packages tree getting messed up, I'd prob have to do a reinstall over the existing installation cuz I read somewhere that the installed-package list is created only during installation of the operating system.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleted /var/log/messages, can't log any files-iptables chingyenccy Linux - Newbie 7 02-27-2005 04:03 PM
Deleted /var/log/messages, how to create a new one? chingyenccy Linux - Security 2 02-27-2005 10:06 AM
message, message.1 in /var/log/ can be deleted for space? phpsharma Linux - Newbie 4 11-17-2004 12:23 PM
Accidentally deleted files rwalkerphl Linux - Newbie 3 06-24-2004 06:11 PM
accidently deleted /var/log/packages lennard Slackware 8 06-21-2004 02:15 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration