LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   wat should be done if /var/log/messages file is deleted (https://www.linuxquestions.org/questions/linux-newbie-8/wat-should-be-done-if-var-log-messages-file-is-deleted-734534/)

deepya 06-21-2009 07:02 AM

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.

harry edwards 06-21-2009 07:17 AM

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.

deepya 06-21-2009 10:01 AM

Quote:

Originally Posted by harry edwards (Post 3581244)
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????

anomie 06-21-2009 10:10 AM

You'll need to:

# touch /var/log/messages

Be more careful with root, please.

ml41782 06-21-2009 10:21 AM

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 !!

arizonagroovejet 06-21-2009 04:48 PM

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.

Tinkster 06-21-2009 04:54 PM

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


All times are GMT -5. The time now is 02:10 AM.