Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cron Jobs 1

Status
Not open for further replies.

kizmar2

Programmer
May 25, 2004
164
US
I'm trying to set up a cron job to automatically back up a mysql database on a web host account.

I have researched the script for mysqldump and I'm under the assumption that what I have should output the insert statements (data) as well as the structure of the DB. All I'm getting in the SQL file output is the structure though.

Here's the script:

Code:
#!/bin/sh

[i](the line below is all one line)[/i]
mysqldump --opt -e db_name --password='hidden' --user='hidden' > /home/path/to/file/backup.sql

Am I missing something?

KizMar
------------
 
mysqldump --user='user' --password='password' --complete-insert --quick database table [--where='where clause']

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
add:
-A or --All-databases
to the end

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Awesome it's working, thanks! This is what I ended up using in case anyone else can use it: (all on one line)

Code:
mysqldump --user='username' --password='password' --extended-insert bd_name > /path/to/file/backup.sql

KizMar
------------
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top