Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sylog and Messages files

Status
Not open for further replies.

neffster

IS-IT--Management
Sep 2, 2003
1
NO
Hi,

I am kinda new to the Linux world. Just a question. I used gzip to compress backups of the files "messages" and "syslog" located on /var/log/ on my Linux machine which I am using as a firewall. When using gzip I noticed that is compressed the files and removed them.

Will the system itself create new files when it sees them as missing? Or do I have to make them myself with the right permissions?

Thanx in advance! :)


Steffen
 
Steffen, to answer your question directly, most loggers will write a new file if their logfile goes missing. That said, syslogd really doesn't like to see logfiles disappear. I would "service syslogd restart" (or whatever your distro needs) to restart the kernel/system loggers after you mess with the log files.

That said, are you aware that 'logrotate' is a normally scheduled task that can be configured to safely age, compress, rotate, etc. your logfiles? Amongst its options is to move the current "messages" log to "messages.1", start a new "messages" logfile, and gzip "messages.1".

I mention it because you could leverage logrotate to do the log rotation and compression and then you could script the "scp" or "ftp" or "mail" of your mostly recent logfiles off of the box (which I infer is the objective from your post).

man logrotate

Good luck.

"Surfinbox Shares" - A fundraising program that builds revenue from dialup Internet users.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top