LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-29-2020, 03:45 AM   #1
tuxthegreat
Member
 
Registered: Mar 2018
Posts: 88

Rep: Reputation: Disabled
Accidently removed syslog


I ran a command that I shouldn't have rm syslog* and alternatives log and kern log and dpkg log and rsyslog because they were filling up a lot of space. Now I can't get them back. My var log looks like this
Code:
/var/log# ls
alternatives.log    dist-upgrade    lightdm              pihole.log.1              syslog.1
alternatives.log.1  dpkg.log        lighttpd             pihole.log.2.gz           unattended-upgrades
apcupsd.events      dpkg.log.1      ntpstats             pihole.log.3.gz           wtmp
apt                 fontconfig.log  pihole               pihole.log.4.gz           wtmp.1
auth.log            journal         pihole-FTL.log       pihole.log.5.gz           Xorg.0.log
auth.log.1          kern.log        pihole-FTL.log.1     pihole_updateGravity.log  Xorg.0.log.old
auth.log.2.gz       kern.log.1      pihole-FTL.log.2.gz  rsyslog.log
btmp                kern.log.2.gz   pihole-FTL.log.3.gz  rsyslog.log.1
btmp.1              lastlog         pihole.log           syslog
How can I get my syslog back? I know it;s listed but du -h syslog = 0

Last edited by tuxthegreat; 06-29-2020 at 03:47 AM.
 
Old 06-29-2020, 03:46 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 14,700

Rep: Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801
syslog is there. But if there was no other way: touch it again (to create), set permissions and reboot
 
Old 06-29-2020, 03:49 AM   #3
tuxthegreat
Member
 
Registered: Mar 2018
Posts: 88

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
syslog is there. But if there was no other way: touch it again (to create), set permissions and reboot
What permissions would i have to set, excuse my nobishness.
 
Old 06-29-2020, 03:58 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 14,700

Rep: Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801Reputation: 4801
that may depend on the os. for me:
Code:
-rw-r-----  1 syslog            adm                92227 jun   29 10:51 syslog
 
Old 06-29-2020, 04:16 AM   #5
tuxthegreat
Member
 
Registered: Mar 2018
Posts: 88

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
that may depend on the os. for me:
Code:
-rw-r-----  1 syslog            adm                92227 jun   29 10:51 syslog
Excuse my lack of knowledge but how do I set permission once I created (touch) syslog. And again thank you for your patience.
 
Old 06-29-2020, 04:20 AM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 1,024

Rep: Reputation: Disabled
Code:
sudo chown --reference=/var/log/auth.log /var/log/syslog
sudo chmod --reference=/var/log/auth.log /var/log/syslog
 
1 members found this post helpful.
Old 06-29-2020, 04:24 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,917

Rep: Reputation: 3250Reputation: 3250Reputation: 3250Reputation: 3250Reputation: 3250Reputation: 3250Reputation: 3250Reputation: 3250Reputation: 3250Reputation: 3250Reputation: 3250
If logs are filling, might pay to find out why before erasing them.
 
1 members found this post helpful.
Old 06-29-2020, 04:29 AM   #8
tuxthegreat
Member
 
Registered: Mar 2018
Posts: 88

Original Poster
Rep: Reputation: Disabled
Hey guys It worked! Thanks a ton!
 
  


Reply

Tags
rm, syslog


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
Removed accidently removed panel at Suse 11.1? alte_mann SUSE / openSUSE 6 01-29-2009 04:19 AM
accidently removed internet icon firedancer Ubuntu 3 08-07-2007 07:38 AM
HELP! accidently removed files RobHill Linux - General 2 06-01-2007 01:04 PM
Fixing the menu bar?? Accidently removed some icons.... Dimitriy Debian 1 10-29-2005 10:06 AM
dselect, removed necessary packages accidently eggsally Debian 3 06-02-2004 03:46 PM

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

All times are GMT -5. The time now is 04:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration