Page 1 of 1
SSH and auto backups
Posted: Thu Mar 17, 2005 5:18 am
by rsmarsha
I have been told i can set cron jobs on my host using SSH, but i've no idea how to do this. I need to find some way of backing up a MySQL database automatically.
Any ideas?

Posted: Thu Mar 17, 2005 6:08 am
by rsmarsha
I have downloaded putty and logged into my server via SSH, but i can't connect to the db itself. My db is not localhost so not sure how to connect to it.
Posted: Thu Mar 17, 2005 11:18 am
by timvw
it's clearly explained in the mysql manual. -hhhhhhhhhhhhh host / mysqldump
Posted: Fri Mar 18, 2005 3:13 am
by rsmarsha
Yeah managed it now.
One thing though, do i need a new cron tab for each job? Or is leaving a blank line below each one ok?
Posted: Sat Mar 19, 2005 11:18 am
by rsmarsha
Also my crontab doesn't seem to overwrite the existing file each time. Do i need to specify something to make it overwrite the previous days backup?
Do i need to make it remove the file first? Or is there a way to make it dump the file with the days date as part of the name?
Posted: Sat Mar 19, 2005 5:16 pm
by timvw
how hard can it be to do a websearch on "mysql backup"?
usually, in your script you use the date program so you can append it to your file.
on the other hand, you could tar|gz the backup and/or make incremental backups during weekdays.. and start a new full backup every sunday...
just choose what you like most
