DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What is the easiest way to clear all the system logs so that it just looks like a fresh system. I have created a customized image of a debian install on my workstation which I would like to install on numerous identical system. So when the user starts using it, they should just see the logs as if the installed system is fresh. Does any one have scripts like that?
$ apt-cache search logfiles
grc - generic colouriser for everything
libfile-tail-perl - File::Tail perl module
liblogfile-rotate-perl - Perl module to rotate logfiles.
lire - full-featured log analyzer and report generator
lire-devel-doc - Developer's documentation for Lire 2.0
lire-doc - Documentation for Lire 2.0
radiuscontext - RADIUS log parser and report generator
analog - analyzes logfiles from web servers
apache2-utils - utility programs for webservers
apachetop - Realtime Apache monitoring tool
cron - management of regular background processing
fwanalog - firewall log-file report generator (using analog)
libadns1-bin - Asynchronous-capable DNS client library and utilities
log2mail - Daemon watching logfiles and mailing lines matching patterns
logcheck - mails anomalies in the system logfiles to the administrator
logtail - Print log file lines that have not been read
pisg - Perl IRC Statistics Generator
remstats-servers - Remote Statistics System: remote information servers
xlogmaster - A program to monitor logfiles
xwatch - A logfile monitor that displays in an X window.
multitail - view multiple logfiles windowed on console
prelude-lml - Hybrid Intrusion Detection System [ Log Monitoring Lackey ]
conserver-client - connect to a console server
conserver-server - connect multiple user to a serial console with logging
this will delete the contents of the file without removing the file itself or changing any of it's permissions. Repeat as necessary for each log file, write into a bash script whatever.. then delete all the numbered log files ( i.e. messages.1.tar.gz ) which are old logs that have been backed up from logrotate or a similar app.
But none of the suggestions worked for me. Neither the script(single find -type ...command) nor the logrotate. Everyone keeps referring to logrotate, but I still don;t get it. Does that mean that for every file in the /var/log directory we will have to write a rule in the logrorate.conf file? Wouldn't that be too much of work to write a rule for every single file. I might as well use the cat /dev/null >> <filename> as many number of time as the file under /var/log directory are.
Not for every file, but for every log type. For example, I have 1 entry in /etc/logrotate.d for each of cups, samba, squid, syslog & vsftpd. Since you can create a new entry from an existing one with cp and edit from there, it's not that much work.
Not for every file, but for every log type. For example, I have 1 entry in /etc/logrotate.d for each of cups, samba, squid, syslog & vsftpd. Since you can create a new entry from an existing one with cp and edit from there, it's not that much work.
Thanks for the information. Actually, everynow and then I keep installing various packages, so if I use the logrotate, I would have to go and add entry everytime. A script which just clears out all the log file inside /var/log directory would be the optimum solution in my case.
Easy bin file to clear any listed logs in the bin file
/root/Desktop/logclear.bin
COPY the below into your favorite txt editor save as logclear.bin set permissions to execute user root grp root pick a nice icon for it save to desktop
then click it pick RUN IN TERMINAL or from cammand line cd to roots desktop and execute it
[root@mail Desktop]# ./logclear.bin
[root@mail Desktop]#
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.