Mysql cronjob backups

Status
Not open for further replies.

clangoon

New Member
Messages
6
Reaction score
0
Points
0
Does anyone know how I would schedule a cron job to backup a phpBB2 forum at midnight each night?
I've looked on the web but not found much helpful stuff :(
 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Easiest thing in the world.

Add this to your crontab :p
Code:
0 0 * * * * mysqldump -udbusername -pdbpassword db_name | gzip > /home/cpanelusername/yourfolder/mysql_backup.gz
 

clangoon

New Member
Messages
6
Reaction score
0
Points
0
Could that be changed to save the file+date, so it didn't overwrite the backup from the day before?
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
I think you'd have to use cron to execute a PHP script or something similar. I don't believe you can insert variables into the cron command like day\time.

-Corey
 
Status
Not open for further replies.
Top