Re: OT - php/mysql/cron
| From: | Tobyn Baugher | Date: | Mon, 03 Jun 2002 17:28:58 +0000 |
| Subject: | Re: OT - php/mysql/cron | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100438@lists.php.net to get a copy of this message | ||
On Mon, 2002-06-03 at 13:18, Kelly Meeks wrote:
> Any way to use cron to automate the mysqldumping of databases on a nighly basis?
>
> Any examples would be greatly appreciated.
This line's gonna wrap, but it all goes on the same line :P
0 0 * * * /usr/local/bin/mysqldump -u <username> --password=<password>
<database> > <outputfile>
Obviously replace <username>, <password>, <database>, and <outputfile>
with the values you want to use for each.
Of course, I would never recommend putting a "secure" password in a text
file like your crontab, so if you have admin rights on the server maybe
consider setting up a read-only account with no password, or maybe a
unique password that won't work on any other accounts.
Never hurts to be a little paranoid.
HTH,
Toby