Free Up Some Time and Your Todo List

Library Web Chic recently talked about using cron on *nix boxes to automate web server log file rotations. At MPOW I use cron quite a bit on our Linux boxes. Once you get the hang of it, cron makes it so easy to automate tasks. On our web server, I use cron to do the following:

Hourly:

  • check for odd things in system files using logcheck
  • run some administrative tasks for Drupal (content management system)
  • send out event reminders for Webcalendar (this runs every minute)

Nightly:

  • backup all files to external disk using tar & gzip
  • backup all files to an off-site server using rsync
  • run web statistics software
  • run a virus scan using clamAV
  • sync up with time servers with ntpdate
  • use grep to find any PHP script warnings/errors from the web server log

Weekly:

  • use df to email me a report on disk space usage
  • run the last command to see who has logged in
  • verify ports in use using nmap

Monthly:

  • rotate web server logs using logrotate

I also use cron with the PHP command line interpreter to run some custom scripts. Like emailing the staff each morning with current numbers from our event registration system. If you can do some scripting, you can automate almost anything with cron.

  • Share/Bookmark

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*