Jump to content

Setting Backup Cron Job (MySQL)

Recommended Posts

I'm needed help on setting up an Cron job, I know how Cron works and how to add it but I seem that I can't get the code right and it's not doing what I wanted it to do. I explain what I am after.

-I want to set up an cron job so that every 24 hours (a day) MYSQL gets backed up into my folder on the server.
-I want the cron to be setup so that it keeps the backups for 7 days before it gets removed, so should be around 7 MYSQL backup files in the backup folder. 

This is what I have so fair that does work but doesn't back up the full amount in folder

mysqldump -uNAME -PASSWORD >/home/*****/backups/database_dump.sql

Every day it backup the following, and not the full MYSQL which is 500 or so MB

Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help


Link to comment
Share on other sites

16 hours ago, EmpireKickAss said:

I Check that out later, have anyone tried this? Also is the automatic install safe to use?

I used to use that script ages ago but not in the last year or so as we have AWS backing it up for us now.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...