Page 2 of 2

Re: Easy Database Backup Script

Posted: Tue Jun 26, 2007 1:07 pm
by citizenine
Elijah --

It works great! Many, many thanks. (I bumped your karma :))

I had it working (i.e., I was getting the "Database backup created and sent!" message on my screen when I ran it manually) but the email was not arriving. I had been under the impression that the code didn't need any personalization because it picked up everything necessary from my cmsms config.

I found that if I replaced "youremail@example.com" with my email address in the top lines of the code, it worked fine. (My config.php doesn't have my email address.)

Also, when I set the cron job using cPanel, it asks for my email address. So between the two email specifications it is now working fine as a cron job.

Nota Bene: For anyone setting up a cron job, be sure to append "> /dev/null" to the example given above, so it looks like this:

php /home/your_name/public_html/backups/backup-database-cron.php > /dev/null
(as mentioned above by chilsta)

It's also worth noting that in setting the time for the cron job, the time specified will be local time for the location of the server, not necessarily of the user.

Thanks, again, Elijah.

Re: Easy Database Backup Script

Posted: Sun Jul 22, 2007 9:26 pm
by tigercat
I stored the script in a plain php file in my CMS directory (first attempt with cron jobs (confixx) did not work). At the moment don`t know why.

Backup fails because my provider does not allow exec like skypanther also mentioned. Is there any possiblility to get your script working, Elijah?

Executing the script was only possible on root level of CMS (not in subfolder like recommended).

Thanks.

Re: Easy Database Backup Script

Posted: Sun Jul 22, 2007 9:43 pm
by Elijah Lofgren
Hi Tigercat,
tigercat wrote: Backup fails because my provider does not allow exec like skypanther also mentioned. Is there any possiblility to get your script working, Elijah?
Sorry, I can't help you here, my web host allows it and I don't have time to look around for a workaround.
You may want to try one of these modules which you can use to manually backup your database:
http://dev.cmsmadesimple.org/projects/mysqldump/
http://dev.cmsmadesimple.org/projects/databasebackup/

Hope this helps,

Elijah

Re: Easy Database Backup Script

Posted: Mon Jul 23, 2007 2:43 pm
by tigercat
Hi there Elijah.

Ok, I'll give them a try ;-)
Let's find out if it works for me. Anyway the summary of mysqldump on http://dev.cmsmadesimple.org/forum/foru ... rum_id=812 sounds good.

Regards.

Re: Easy Database Backup Script

Posted: Mon Mar 16, 2009 6:59 pm
by Franz
Great job, thanks!!!  :)