| Topic Archived |
View previous topic :: View next topic |
| Author |
Message |
FrontRunner Nice poster


Offline Joined: Feb 27, 2005 Posts: 62 Location: Netherlands
|
Posted: Fri Sep 30, 2005 6:44 am Post subject: Database: Auto Backup functionality |
|
Was just wondering, as a request or idea, if the next version of CPG Nuke could have a Auto Backup functionality for the database. Currently my ISP doesnt do a auto backup of our database so i´m using 3rd party software to do that for me.
I think it would be great if you could select the auto-backup functionality (on/off) and that the backup file is saved in a seperate folder or ftp-ed to another fileserver or even emailed.
_________________

FrontRunner's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) FreeBSD/Apache/1.3.33/MySQL 4.0.24/PHP 5.0.4/CPGNuke 9.0.6.1
|
|
| Back to top |
|
 |
norbie Silver Supporter


Offline Joined: Jun 29, 2004 Posts: 737 Location: Norbie's World
|
Posted: Fri Sep 30, 2005 7:29 am Post subject: Re: Database: Auto Backup functionality |
|
I second this as I can't get a cronjob to work for me.
My host says to use PHP instead of Perl, so integrated into the system would be great!
_________________ Norbie

www.norbiesworld.co.uk
norbie's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux / Apache Custom Version / 4.0.26-standard (client: 5.0.15) / 4.4.4 / 9.1.1
|
|
| Back to top |
|
 |
mc__ Debugger


Offline Joined: Jul 12, 2005 Posts: 452 Location: QLD, Australia
|
Posted: Fri Sep 30, 2005 7:55 am Post subject: Re: Database: Auto Backup functionality |
|
I could code a raw dumping one easily, and it'd be tar'd then bz2'd so it'd take like no space at all. But df already has 'proper' db backup function so we should use that instead, and just stream its output into a local file, then exec() tar followed by bzip2 on the php-created text file.
However to make it do this when no ones visiting would be hard. I do not think that you can have a php script just invoke itself. It'd have to keep a last_updated record, and when it is next run if it is a certain time after that then it performs a backup. Maybe put a call to it in each of your theme header templates so someone just needs to visit the page to activate it.
Sounds do-able, but i haven't looked at it.
_________________

mc__'s server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux (Kernel: 2.4.21-27.0.2.ELsmp)/1.3.33 (Unix)/4.0.24-standard/4.3.11/9.0.5.0
|
|
| Back to top |
|
 |
DJ Maze Developer


Offline Joined: Apr 19, 2004 Posts: 5683 Location: http://tinyurl.com/5z8dmv
|
Posted: Fri Sep 30, 2005 11:17 am Post subject: Re: Database: Auto Backup functionality |
|
Perl and PHP are both not adviced for cronjobs because they will produce an overhead.
I already provided somewhere in these forums a shell script to use as cronjob. FYI maybe it's already in the FAQ or Wiki
Secondly the shell script could be easily converted to PHP if you realy need such bad thing.
DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
|
|
| Back to top |
|
 |
norbie Silver Supporter


Offline Joined: Jun 29, 2004 Posts: 737 Location: Norbie's World
|
Posted: Fri Sep 30, 2005 1:59 pm Post subject: Re: Database: Auto Backup functionality |
|
Sorry, I think I meant Shell. I've tried the one from the a post of yours in the forum, the one in the Wiki, and the PHP script there, but none of them seem to work.
My host just said they recommend using PHP rather than Shell/Perl.
_________________ Norbie

www.norbiesworld.co.uk
norbie's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux / Apache Custom Version / 4.0.26-standard (client: 5.0.15) / 4.4.4 / 9.1.1
|
|
| Back to top |
|
 |
Mystic Diamond Supporter


Offline Joined: Jun 25, 2004 Posts: 1312 Location: Spokane, WA USA
|
Posted: Fri Sep 30, 2005 2:04 pm Post subject: Re: Database: Auto Backup functionality |
|
| norbie wrote: |
| My host just said they recommend using PHP rather than Shell/Perl. |
Time to recommend a new host?  I use a script written by Tsykoduk that works great!
_________________ - |\/|ystic
Mystic's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.20-16/Apache/5.0.38/5.2.1/9.0.6.1
|
|
| Back to top |
|
 |
norbie Silver Supporter


Offline Joined: Jun 29, 2004 Posts: 737 Location: Norbie's World
|
Posted: Fri Sep 30, 2005 2:13 pm Post subject: Re: Database: Auto Backup functionality |
|
Nah, apart from that they're brilliant in what they offer.
I was told
| Quote:: |
Perl/CGI scripts can be tricky to setup and we do always recommend using PHP scripts.
Check list for CGI scripts:
- Upload using ASCII
- Set permissions correctly (chmod), this seems to be correct
- Use the correct Perl path
I hope this may help, |
I could take a look at that script though please?
_________________ Norbie

www.norbiesworld.co.uk
norbie's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux / Apache Custom Version / 4.0.26-standard (client: 5.0.15) / 4.4.4 / 9.1.1
|
|
| Back to top |
|
 |
FrontRunner Nice poster


Offline Joined: Feb 27, 2005 Posts: 62 Location: Netherlands
|
Posted: Fri Sep 30, 2005 2:31 pm Post subject: Re: Database: Auto Backup functionality |
|
Currently trying to use phpMyBackupPro 1.7.1. Installed and configured it today, so that it auto backups the database once every 24hours. Need to see if it works properly tho. If CPG Nuke could include that into the backup module, it would be great.
_________________

FrontRunner's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) FreeBSD/Apache/1.3.33/MySQL 4.0.24/PHP 5.0.4/CPGNuke 9.0.6.1
|
|
| Back to top |
|
 |
tsykoduk Nice poster


Offline Joined: May 31, 2004 Posts: 103 Location: a Chair
|
Posted: Fri Sep 30, 2005 11:06 pm Post subject: Re: Database: Auto Backup functionality |
|
If you have shell access and cron access, you can crop together a quick script liek the following..
| Code:: |
cd ~/backup
rm backup5.sql
mv backup4.sql backup5.sql
mv backup3.sql backup4.sql
mv backup2.sql backup3.sql
mv backup1.sql backup2.sql
mv backup.sql backup1.sql
mysqldump --all-databases >backup.sql |
I have a backup folder off the root of my site, and the script lives there. Each day, it rotates 5 days worth of backups and then grabs a complete mysql backup of all of the DB's on my host.
Quick, painless and easy.
Tomorrow FTP'ing it to a remote host for even more backup goodness.
_________________ For a Good Time
For a Bad Time
For a Geeky Time

tsykoduk's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) OS X 10.8.2.1/3.9/8.2/1.0alpha/Next Gen
|
|
| Back to top |
|
 |
javafaq Supporter


Offline Joined: Feb 01, 2005 Posts: 33 Location: Sweden
|
Posted: Tue Oct 18, 2005 1:50 pm Post subject: Re: Database: Auto Backup functionality |
|
I use this script for more than two years:
sourceforge.net/projec...ysqlbackup
and never had a porblem. It makes incremental backup - daily, weekly, monthly and reports you by email.
Do not invent the wheel - improve it!
javafaq's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) CentOS3.3/2.x/4.1.x/4.3.x/9.1
|
|
| Back to top |
|
 |
tour93 Gold Supporter


Offline Joined: Apr 20, 2004 Posts: 526 Location: florida
|
Posted: Wed Nov 30, 2005 4:05 am Post subject: Re: Database: Auto Backup functionality |
|
Hi,
Is there a way to do a backup and email a link to that backup. Because all the cron backup I looked at (automysqlbackup.sh, cronjob.sh) seem to email the all backup?
Thanks
_________________

tour93's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/1.3.39/4.1.22/4.4.7/Dragonfly9.1.2.1
|
|
| Back to top |
|
 |
FrontRunner Nice poster


Offline Joined: Feb 27, 2005 Posts: 62 Location: Netherlands
|
Posted: Wed Nov 30, 2005 1:25 pm Post subject: Re: Database: Auto Backup functionality |
|
| tour93 wrote: |
Hi,
Is there a way to do a backup and email a link to that backup. Because all the cron backup I looked at (automysqlbackup.sh, cronjob.sh) seem to email the all backup?
Thanks |
I think that it should be possible with a little hack of these scripts (soz, i cant do it). What I´ve done is opened an additional Gmail-account (it can hold 2,7gb of data) and have my back-ups emailed to it! That way i have a back up on the server and one in gmail.
If you´re in need of an gmail account, contact me!!
_________________

FrontRunner's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) FreeBSD/Apache/1.3.33/MySQL 4.0.24/PHP 5.0.4/CPGNuke 9.0.6.1
|
|
| Back to top |
|
 |
tour93 Gold Supporter


Offline Joined: Apr 20, 2004 Posts: 526 Location: florida
|
Posted: Wed Nov 30, 2005 1:41 pm Post subject: Re: Database: Auto Backup functionality |
|
ok thanks, but I already have some gmails account.
_________________

tour93's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/1.3.39/4.1.22/4.4.7/Dragonfly9.1.2.1
|
|
| Back to top |
|
 |
tsykoduk Nice poster


Offline Joined: May 31, 2004 Posts: 103 Location: a Chair
|
Posted: Wed Nov 30, 2005 9:18 pm Post subject: Re: Database: Auto Backup functionality |
|
Hold on a sec...
Try this script:
| Code:: |
cd ~/backup
rm backup5.sql
mv backup4.sql backup5.sql
mv backup3.sql backup4.sql
mv backup2.sql backup3.sql
mv backup1.sql backup2.sql
mv backup.sql backup1.sql
mysqldump --all-databases >backup.sql
cat backup.sql |mail -s "Backup" -t tsykoduk @ gmail.com
|
This did not work on my host - the mail command is disabled. If your host is more freindly, that should work fine. I use a simlar command to email me reports from my work servers.
_________________ For a Good Time
For a Bad Time
For a Geeky Time

tsykoduk's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) OS X 10.8.2.1/3.9/8.2/1.0alpha/Next Gen
|
|
| Back to top |
|
 |
tour93 Gold Supporter


Offline Joined: Apr 20, 2004 Posts: 526 Location: florida
|
Posted: Wed Nov 30, 2005 9:24 pm Post subject: Re: Database: Auto Backup functionality |
|
Hi tsykoduk,
I create this folder, backup, where the "blocks" folder is?
| Quote:: |
| mysqldump --all-databases >backup.sql |
Do I need to replace all-database with the name of my db?
Do I need to save that script as a .sh and call it with a cron job?
_________________

tour93's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/1.3.39/4.1.22/4.4.7/Dragonfly9.1.2.1
|
|
| Back to top |
|
 |
|
|