Kinetic Pulse
  • Home
  • Services
  • Portfolio
  • Blog
  • Terms
  • Contact

Useful crontabs for backups & scheduled emails

May 11, 2011

I thought I would document how I got the following scheduled jobs working on my clients RapidHosts hosting. It involved a lot of trial & error to get them going so thought I should share them. (Note: You’ll obviously need to change the web directory, back up folders & db credentials to suit your setup)

The following runs a MySQL DB backup and stores it as a date stamped gzip file

/usr/bin/mysqldump -u username dbname -ppassword |gzip> /var/www/vhosts/yoursite.co.uk/httpsdocs/backups/BACKUP.`date +”\%Y-\%m-\%d”`.gz

The following runs a full file backup and stores it as a date stamped tar file
tar -cvpzf /var/www/vhosts/yoursite.co.uk/httpsdocs/backups/`date +”\%Y-\%m-\%d”`.tar /var/www/vhosts/yoursite.co.uk/httpdocs/

The following runs a scheduled email reminder to customers

/usr/bin/php -q /var/www/vhosts/yoursite.co.uk/httpdocs/sendEmail.php
(sendEmail.php is the php file that contains the email logic)

As far as schedules go I have the first two running as a weekly job running on Sundays – whereas the reminder email is going out daily.

Obviously let me know if you can find a better way of doing this!

Share

Facebook Google+ Twitter Pinterest Email

Back to Blog

Testimonials

It’s been fab working with you – we love the site and certainly going to recommend you!
James DaviesThirty Eight Degrees North
Thank you guys so much for all that you’ve done helping us to create a really awesome website!! We get such great feedback – everyone loves it & we couldn’t be prouder! Look forward to working with you again soon!
Wild Thyme PlantsWild Thyme Plants
Amazing and brilliant, Kinetic Pulse have lifted a dream to reality, Highly recommended and great if you are total novice, they know their stuff…Thanks again
Annie LindridgeSalt Yourself Out
Thanks so much for all your work on this, really appreciated. It’s come on in leaps and bounds since you took over.
Pete KewRedwood Strip Curtains
Absolutely fantastically professional web developer – I would highly recommend!!! Thank you so much Kinetic Pulse!
Tania MarstonDoris Designs
Thank you for all of your hard work its looks fab and I am over the moon with it!
Amanda MercerAmanda Mercer Ceramics
I like it.  I like it a lot !!!

 You have interpreted what I wanted to achieve perfectly considering what you have to play with i.e not redoing the whole thing in the process.

Fiona Simmons-MooreSouth Gloucestershire Parents & Carers

Copyright 2026 Kinetic Pulse