LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-21-2009, 07:02 AM   #1
deepya
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Rep: Reputation: 0
wat should be done if /var/log/messages file is deleted


Hi,
By mistake I deleted /var/log/messages file.Will that harm the OS or the softwares running on linux in any way????????If so,is there any method by which I can avoid it.

Thank you,

Sree Deepya.

Last edited by deepya; 06-21-2009 at 07:03 AM.
 
Old 06-21-2009, 07:17 AM   #2
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
It will not cause any harm; however, you obviously lost any information in the file. To prevent this happening in the future you may wish to log on as a non-privileged user or use the "-i" switch on rm.
 
Old 06-21-2009, 10:01 AM   #3
deepya
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by harry edwards View Post
It will not cause any harm; however, you obviously lost any information in the file. To prevent this happening in the future you may wish to log on as a non-privileged user or use the "-i" switch on rm.
In future will the system save the logs????
 
Old 06-21-2009, 10:10 AM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
You'll need to:

# touch /var/log/messages

Be more careful with root, please.
 
Old 06-21-2009, 10:21 AM   #5
ml41782
LQ Newbie
 
Registered: May 2009
Posts: 14

Rep: Reputation: 0
Never run the box as root. Run all apps as a user. only use root when you absoluteley have too. and then get out of it.

Be oh so careful when you are running as root !!
 
Old 06-21-2009, 04:48 PM   #6
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Add this to root's .bashrc file

Code:
alias rm='rm -i'
then next time you try and delete a file with rm you'll be asked if you're sure you want to do it.
 
Old 06-21-2009, 04:54 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
If you've deleted a file that's being written to you probably should
restart syslogd, otherwise it'll keep pushing log messages into what
will disappear next time the logs get rotated.



Cheers,
Tink
 
  


Reply

Tags
deleted, done, file, if, should



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
/var/log/messages and /var/log/cron not working sigkill Linux - Software 6 08-09-2008 01:08 PM
Hard drive udma-33 reset problem in var/log/messages v00d00101 Linux - Kernel 3 02-14-2008 09:45 PM
Are these entries a problem in my /var/log/messages jim.thornton Linux - Server 4 02-08-2008 08:16 AM
/var/log/messages problem x42bn6 Linux - Security 4 03-24-2007 07:04 PM
Redirecting the kernel messages to file other than /var/log/messages jyotika_b83 Linux - General 3 04-28-2005 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:20 AM.

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