PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
giantmidget
Hangin' Around


Joined: Nov 27, 2005
Posts: 44

PostPosted: Mon Nov 06, 2006 6:32 pm Reply with quote Back to top

Would it be possible to incorporate automatic database backups into Raven Nuke - configurable by the user for times, and just saved on the site somewhere in a backup folder ?

Saw someone attempt this before through Cron Jobs, but I do not remember the info. Would be easier through a nuke interface.
View user's profile Send private message
montego
Former Admin in Good Standing


Joined: Aug 29, 2004
Posts: 9071
Location: Arizona

PostPosted: Mon Nov 06, 2006 6:38 pm Reply with quote Back to top

This has not been discussed internally, however, you may want to check out this:
Only registered users can see links on this board!
Get registered or login to the forums!


I have used his auto backup before in combination with my Windows built-in scheduler to kick off the backup on whatever schedule I choose.
View user's profile Send private message Visit poster's website
loraxx
Regular
Regular


Joined: Jan 24, 2008
Posts: 58

PostPosted: Fri Feb 29, 2008 7:20 pm Reply with quote Back to top

I tool would love to have a built in backup system. I will check out your link montego.
View user's profile Send private message
loraxx
Regular
Regular


Joined: Jan 24, 2008
Posts: 58

PostPosted: Fri Feb 29, 2008 7:58 pm Reply with quote Back to top

loraxx wrote:
I tool would love to have a built in backup system. I will check out your link montego.


Ok program installed and ran well. I got my back in an email but it did not import. I recieved the following errror. Did you resolve this montego?

Image
View user's profile Send private message
montego
Former Admin in Good Standing


Joined: Aug 29, 2004
Posts: 9071
Location: Arizona

PostPosted: Sat Mar 01, 2008 7:32 am Reply with quote Back to top

loraxx, I have never installed it as I am using my control panel backup tool provided by my host. Most, if not all?, hosting control panels have a backup option and you can even use an FTP client on your PC to automatically pull it down. I just have no need for a PHP-based solution.
View user's profile Send private message Visit poster's website
loraxx
Regular
Regular


Joined: Jan 24, 2008
Posts: 58

PostPosted: Sat Mar 01, 2008 11:06 am Reply with quote Back to top

My control panel allows me to make backup and FTP is also an option. However, I was looking for something that would make backups while I'm out of town or start to get lazy. It gives me a warm fuzzy to know that my sites database is backuped daily and a copy is at a third location decoupled from my web hosting company,
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Sat Mar 01, 2008 2:53 pm Reply with quote Back to top

Does your control panel let you do cron jobs?
View user's profile Send private message
loraxx
Regular
Regular


Joined: Jan 24, 2008
Posts: 58

PostPosted: Sat Mar 01, 2008 4:34 pm Reply with quote Back to top

Why yes it does standard and advance. I did not know it did. Remember this in only my first month doing the website thing, so sorry for being such a noob. I'm trying to learn fast.
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Sat Mar 01, 2008 4:43 pm Reply with quote Back to top

No problem!!! Perhaps you can use cron to schedule backups somehow. That's how I do it, but I have root access to my box.
View user's profile Send private message
loraxx
Regular
Regular


Joined: Jan 24, 2008
Posts: 58

PostPosted: Sat Mar 01, 2008 4:46 pm Reply with quote Back to top

Thanks I will check it out. Another jounrney for the noob Smile

If you have time please look at my post below:
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message
loraxx
Regular
Regular


Joined: Jan 24, 2008
Posts: 58

PostPosted: Sun Mar 02, 2008 12:06 am Reply with quote Back to top

Gremmie that cron suggestion was excellent. The power of the cron line command is incredible. The capability exceeds advance nuke backup. So if the web hosting site gives you access to cron no need for advance nuke backup. IM SO HAPPY Very Happy Very Happy Very Happy Very Happy

Thanks !!!

BTW 100% success at making scheduled backups and backups import with 0% loss. Perfect match !!!

Next I will add emailing my zipped backup.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

PostPosted: Sun Mar 02, 2008 9:46 am Reply with quote Back to top

loraxx,

If you would be so kind as to share your cron code/script I will make it a sticky for other users to use. Thanks!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
loraxx
Regular
Regular


Joined: Jan 24, 2008
Posts: 58

PostPosted: Sun Mar 02, 2008 9:55 am Reply with quote Back to top

Raven,

No problem.

I have not figured out the cron email file part yet but will when I have some more time I will post that as well.

If your web host control panel allows cron commands you can use the following command to get a backup of you database and place it in a folder on your sever (note I strongly recommend this folder NOT be in websites folder for security reasons).


date=`date -I` ; mysqldump -uusername -ppassword databasename > /yourfolderlocation/maindatabse_$date.sql; gzip /yourfolderlocation/maindatabse_$date.sql

NOTE:
1. no space after -u and -p
2. databasename, username, and password are all the same form as used in config.php
3. your control panel will allow you to schedule when this command is executed with an infinite number of options


BTW this command also gzips the database when done.

As I have time I will refine this command. Next step is to add emailing of gziped file to remote site.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

PostPosted: Sun Mar 02, 2008 10:11 am Reply with quote Back to top

Thanks!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Doulos
Life Cycles Becoming CPU Cycles


Joined: Jun 06, 2005
Posts: 535

PostPosted: Sun Mar 02, 2008 11:27 am Reply with quote Back to top

could you say that in Linux-for-dummies language? What do we use for yourfolderlocation?

is this the proper format?

home/username/public_html/mysqlbackupfolder ?????

home/username/folderoutsidepublic/mysqlbackupfolder ???


Edit: I found my answer. Thanks
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Sun Mar 02, 2008 12:52 pm Reply with quote Back to top

Here is a Perl script I wrote that does basically the same thing. I have cron run this every night. It does multiple databases.

Code:

#!/usr/bin/perl
# mysqlbackup.pl - Gremmie Feb 22, 2008
# For backing up my MySQL databases

@dbs = (
   {
     db => 'dbname1',
     user => 'dbuser1',
     password => 'dbpass1',
   },
   {
     db => 'dbname2',
     user => 'dbuser2',
     password => 'dbpass2',
   },
   {
     db => 'dbname3',
     user => 'dbuser3',
     password => 'dbpass3',
   },
);

chomp($date = `date +%Y%m%d`);

foreach $db (@dbs)
{
   $outFile = '/var/local/backups/' . $db->{'db'} . $date . '.sql';
   $cmd = "mysqldump --user=$db->{'user'} --password=$db->{'password'} $db->{'db'} " .
      " > $outFile";
   # print $cmd . "\n";
   print "Dumping $db->{'db'}...\n";
   `$cmd`;
   print "Compressing $db->{'db'}...\n";
   `bzip2 $outFile`;
}
print "Done.\n";



Just add or remove array elements for each database you have. And tweak the path it is saving to. Hope someone finds that useful.
View user's profile Send private message
loraxx
Regular
Regular


Joined: Jan 24, 2008
Posts: 58

PostPosted: Thu Mar 06, 2008 8:55 am Reply with quote Back to top

gremmie,

I have been unable to identify a set of commands that will automatically email my backed up files to me. Note, I want to use the cron scheduler not a script since I do not have that capability on my web hosting site.

the mail command drops characters off of binary files I hear, gzip is binary I assume

my host does not support mutt

Any ideas???
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Thu Mar 06, 2008 10:04 am Reply with quote Back to top

I would probably look at it from the PC end. There is probably some ftp software you could get for your PC that you can schedule or script.

You could also run cygwin on your PC. With cygwin you can have cron jobs. If you have ssh access to your server you could schedule a cygwin cron job to scp (secure copy) the backups to your pc.

Those are just off the top of my head...
View user's profile Send private message
loraxx
Regular
Regular


Joined: Jan 24, 2008
Posts: 58

PostPosted: Thu Mar 06, 2008 10:15 am Reply with quote Back to top

Thanks germmie. I'm not familar with any of that stuff but you have now giving me some direction and things to look into.

BTW, I will be installing your map module sometime today. It will compliment some other stuff we have on our site.
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Thu Mar 06, 2008 10:45 am Reply with quote Back to top

I would imagine there is some fancy FTP software that you could get for the PC that you could schedule transfers for. Your host may also have some kind of automatic backup thing you could use too.

Cool on the member map module! Just make sure you have PHP 5 first.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

PostPosted: Thu Mar 06, 2008 11:51 am Reply with quote Back to top

loraxx wrote:
the mail command drops characters off of binary files I hear, gzip is binary I assume


Please explain. The mail() function is just an interface to your MTA (Sendmail, Procmail, etc.) so it doesn't drop characters. If something is getting dropped through your MTA then it's because something isn't configured correctly (probably the mime type).
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
danny234
Worker
Worker


Joined: Feb 14, 2008
Posts: 123

PostPosted: Sat Mar 08, 2008 7:39 am Reply with quote Back to top

Gremmie wrote:
Here is a Perl script I wrote that does basically the same thing. I have cron run this every night. It does multiple databases.

Code:

#!/usr/bin/perl
# mysqlbackup.pl - Gremmie Feb 22, 2008
# For backing up my MySQL databases

@dbs = (
   {
     db => 'dbname1',
     user => 'dbuser1',
     password => 'dbpass1',
   },
   {
     db => 'dbname2',
     user => 'dbuser2',
     password => 'dbpass2',
   },
   {
     db => 'dbname3',
     user => 'dbuser3',
     password => 'dbpass3',
   },
);

chomp($date = `date +%Y%m%d`);

foreach $db (@dbs)
{
   $outFile = '/var/local/backups/' . $db->{'db'} . $date . '.sql';
   $cmd = "mysqldump --user=$db->{'user'} --password=$db->{'password'} $db->{'db'} " .
      " > $outFile";
   # print $cmd . "\n";
   print "Dumping $db->{'db'}...\n";
   `$cmd`;
   print "Compressing $db->{'db'}...\n";
   `bzip2 $outFile`;
}
print "Done.\n";



Just add or remove array elements for each database you have. And tweak the path it is saving to. Hope someone finds that useful.


Gremmie could you please explain your code, I want to backup my website incase mine goes wrong again then I can just use the backup so in my hosting control panel I goto cron jobs and put your code into the command box? What do I put where you have 'out file=' where do I put the date and time I want to run it?

yes I am a complete noob, please forgive me lol
View user's profile Send private message Visit poster's website MSN Messenger
Gremmie
Former Moderator in Good Standing


Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Sat Mar 08, 2008 11:03 am Reply with quote Back to top

danny234, my code sort of assumes you have shell access to your server. I have that file, the perl script, stored in a user directory on the server. Cron runs it every night, copying the backups (and compressing them) to yet another directory on the server. Right now I am periodically ftp'ing the latest backups from the server to my home pc. If you don't have shell access I'm not sure you could make that work. In that case just use your control panel your host gave you to do database backups. You may have to use phpMyAdmin to do it.
View user's profile Send private message
danny234
Worker
Worker


Joined: Feb 14, 2008
Posts: 123

PostPosted: Sat Mar 08, 2008 11:07 am Reply with quote Back to top

So once I have done the backup I get a compressed sql file of the database and this is my whole site backed up? How do I get my website back the way it was from the backup do I just upload the sql compressed file somewhere or do I upload it to my database and my website will be back to the way it was?
View user's profile Send private message Visit poster's website MSN Messenger
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

PostPosted: Sat Mar 08, 2008 2:48 pm Reply with quote Back to top

Excuse the interruption Smile

Danny, doesn't your provide you with nightly backups? If so, then you would just need a cron job that sends you the already backed up file.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum