Backup and Rotate MySQL Databases Simple Bash Script
Make a directory ( it can anywhere ) called baks/mysql
mkdir -p /baks/mysql
Create a file (it can be anywhere) called /root/mysql_backups.sh and put this script in it
# modify the following to suit your environment
Use a Cron Job to Automate Sphinx Index Refresh from Rails Rake Task
If using Sphinx, you need to refresh indexes when you add new content to your database. This is fairly easy to do by hand
rake thinking_sphinx:index RAILS_ENV=production
But if you want to automate this and use a cron, remember to set the PATH, SHELL an...
Set Cron Job to Run Every Five Minutes for a Ruby on Rails Rake Task
First off you'll need to edit your cron file. Normally, the cron files are kept under /etc/cron.daily or /etc/cron.hourly but we can just use the command line tool, crontab and pass it the -e flag, so that we can edit the file without any fuss.