What are a regular maintenance you need to perform on your Linux server?

I have a server that host few websites, I haven't done any maintenance for about 2 month other than looking at a couple logs and compressing them.

Just wondering what are a regular maintenance you need to perform on your Linux server? Are there any scripts that let you do the maintenance?


The most important thing is to keep your server monitored so that you know what's going on the server at every moment. It's important to keep track of disk usage, cpu usage, load, memory usage, traffic, etc. There are a lot of open source tools that can help you with this task. This also helps you to plan future upgrades.

On the other hand, you need to perform regular and automatic backups and it's very important to test your backups once in a while to make sure they're working.

It's also important to check for updates, especially security ones, and install them when needed.

Everything that can be done in an automatic way should be done in an automatic way, but do not forget to check your logs once in a while.

Hope this helps!


There are two useful classes of tool here:

  1. Monitoring Tools like Nagios let you keep track of usage and other stats.
  2. Configuration Management Tools like Puppet and Chef let you make statements about the expected state of a system (what packages it should have installed, what the contents of files should be, etc), and then run periodically to ensure that the system conforms.

Patch your OS to get the latest bugfixes and security updates. This is the single most important step you can take. Beyond that, you need to have monitoring in place to tell you the state of your system over time. I have to disagree with the point above that monitoring is not maintenance. You need to get a baseline understanding of your system and how it runs to see when things are not working or need maintenance in the first place. The only way to really do this is to graph everything. We use a combination of Nagios, cacti, and ganglia for this.

As far as scripts, you mentioned compressing logs, so look at logrotate. There is also logwatch.