So, the other day, my server's database completely crashes. They restored it, but you know.. scary stuff. And of course, while I could imagine files mysteriously disappearing, and kept backups of all that, I never thought about the database, so I was backupless.
But it's a pain to manually do regular backups, any ideas on how to automate it? I use mysql, and normally access it with phpmyadmin. That is, if there are any good ideas that don't involve cron jobs. ^.^:
Anisa.
On Thu, 14 Apr 2005, Anisa wrote:
So, the other day, my server's database completely crashes. They restored it, but you know.. scary stuff. And of course, while I could imagine files mysteriously disappearing, and kept backups of all that, I never thought about the database, so I was backupless.
But it's a pain to manually do regular backups, any ideas on how to automate it? I use mysql, and normally access it with phpmyadmin. That is, if there are any good ideas that don't involve cron jobs. ^.^:
No cron jobs no automatism.
You could write a script that is executed through cron.php though and use poormanscron.
Cheers, Gerhard
On Apr 14, 2005, at 5:57 AM, Anisa wrote:
So, the other day, my server's database completely crashes. They restored it, but you know.. scary stuff. And of course, while I could imagine files mysteriously disappearing, and kept backups of all that, I never thought about the database, so I was backupless.
It's not an immediate solution for this question, but I use a shared hosting service that provides cpanel as the administrative tool for sites. One of cpanel's options is to do a one click full backup, which you can then ftp to another site.
I'm currently trying to find the script cpanel uses to do the backup so I can run a cron job on it. I already have a script that ftps from a remote machine once a day to grab the most recent backup file.
Andrew
------------------------------------------------- Andrew Michael Cohill, Ph.D. Information architect
Design Nine provides technology master planning services, community network planning, technology audits, and telecommunications project management to communities and organizations trying to make wise technology and telecommunications expenditures. Design Nine represents the interests of the organization or community, rather than the interests of vendors.
Visit the Design Nine News page for frequently updated news and commentary on technology issues. http://www.designnine.com/news/
Design Nine, Inc. http://www.designnine.com/ Blacksburg, Virginia Voice: 540.951.4400 Cell: 540.320.4406
Here's what I do:
cd /home/www tar --totals -cpf /home/www/backups/www.domain.org.tar www.domain.org mysqldump -u root -h localhost -p"password" drupal > /home/www/backups/drupal_dump.sql ftp -n </home/www/backups/ftpcommands mail -s "Backup Success" email@domain.com < /home/www/backups/mailtext
The tar backs up the directories into a tar file The mysqldump creates a mysql dump of the drupal database to a .sql file
I then FTP these files to my backup server and email myself a message
I saved this as backup.cron and placed it in my /etc/cron.daily directory.
--- Anisa mystavash@animecards.org wrote:
So, the other day, my server's database completely crashes. They restored it, but you know.. scary stuff. And of course, while I could imagine files mysteriously disappearing, and kept backups of all that, I never thought about the database, so I was backupless.
But it's a pain to manually do regular backups, any ideas on how to automate it? I use mysql, and normally access it with phpmyadmin. That is, if there are any good ideas that don't involve cron jobs. ^.^:
Anisa.
[ Drupal support list | http://lists.drupal.org/ ]
__________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail
A security tip is to put the username and password in a ini file and use the --defaults-file commandline argument. That way nobody can find your database root password using 'ps' the same time as the cron executes your command.
Another thing I tried for a while was to mail myself a gziped and gpg encrypted databasedump. You would have to use a gpg key without any passphrase. The logic beeing that if you send the backup using ftp or just plainmail it will go over hostile ground unprotected. But then again this might be a bit OT =)
Thatguywhowon'tgivehisname said:
Here's what I do:
cd /home/www tar --totals -cpf /home/www/backups/www.domain.org.tar www.domain.org mysqldump -u root -h localhost -p"password" drupal > /home/www/backups/drupal_dump.sql ftp -n </home> mail -s "Backup Success" email@domain.com < /home/www/backups/mailtext
The tar backs up the directories into a tar file The mysqldump creates a mysql dump of the drupal database to a .sql file
I then FTP these files to my backup server and email myself a message
I saved this as backup.cron and placed it in my /etc/cron.daily directory.
--- Anisa mystavash@animecards.org wrote:
So, the other day, my server's database completely crashes. They restored it, but you know.. scary stuff. And of course, while I could imagine files mysteriously disappearing, and kept backups of all that, I never thought about the database, so I was backupless.
But it's a pain to manually do regular backups, any ideas on how to automate it? I use mysql, and normally access it with phpmyadmin. That is, if there are any good ideas that don't involve cron jobs. ^.^:
Anisa.
[ Drupal support list | http://lists.drupal.org/ ]
Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail -- [ Drupal support list | http://lists.drupal.org/ ]
On 4/15/05, Pontus Ullgren ullgren@users.sourceforge.net wrote:
A security tip is to put the username and password in a ini file and use the --defaults-file commandline argument. That way nobody can find your database root password using 'ps' the same time as the cron executes your command.
Another thing I tried for a while was to mail myself a gziped and gpg encrypted databasedump. You would have to use a gpg key without any passphrase. The logic beeing that if you send the backup using ftp or just plainmail it will go over hostile ground unprotected. But then again this might be a bit OT =)
There's a sample backup script in contributions/tricks/MySQL .
eric Farris said:
There's a sample backup script in contributions/tricks/MySQL .
Nice script.
Allthough I would opt for this script to use .ini files instead of using the username and password on the commandline. This is recomended practise by MySQL and much safer.
Would anybody object if I commit a change ?
// Pontus
On Fri, 15 Apr 2005, Pontus Ullgren wrote:
eric Farris said:
There's a sample backup script in contributions/tricks/MySQL .
Nice script.
Allthough I would opt for this script to use .ini files instead of using the username and password on the commandline. This is recomended practise by MySQL and much safer.
Would anybody object if I commit a change ?
Nope, go ahead, but document it.
Thanks, Gerhard