Web Hosting Forum | Lunarpages
News: October 6, 2008 - Submit Your Site for the October 2008 Site of the Month!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 12, 2008, 12:36:53 AM


Login with username, password and session length


Pages: 1 [2] 3 4 ... 7   Go Down
  Print  
Author Topic: Site and MySQL backups via cron  (Read 32244 times)
skylerj
Trekkie
**
Offline Offline

Posts: 15


« Reply #15 on: January 02, 2005, 11:04:28 PM »

Thank you for getting back to me. I'm trying to run the first script that you posted. The only thing that is different from what you posted is the top portion where I put in all of my server settings. This is the error that I get.

Quote
Warning: exec() has been disabled for security reasons in /home/koopat2/public_html/sitebackup.php on line 13

Warning: exec() has been disabled for security reasons in /home/koopat2/public_html/sitebackup.php on line 16
Connected to *****.serveftp.org, for user ***** upload has failed.
Warning: unlink(/home/koopat2/Full_Account_Backup-2005-01-02_22-51-57.tar.gz): No such file or directory in /home/koopat2/public_html/sitebackup.php on line 56

I'm not an expert, but I was under the impression that enableing and disableling of the exec comman for security reasons was something that only server admin could control. Or maybe something else is going on. In any case, I would love some information and advice. Thanks!
Logged
scanman20
Master Jedi
*****
Offline Offline

Posts: 1251



WWW
« Reply #16 on: January 03, 2005, 07:00:31 AM »

Some servers on LP have the exec() function disabled which would make it impossible to use with the above scripts.
Logged

Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP
skylerj
Trekkie
**
Offline Offline

Posts: 15


« Reply #17 on: January 03, 2005, 08:01:13 AM »

That's what I figured was the cause.  If a lunarpage employee confirms that, my question becomes: What are my options in order to have automated backup to an offsite server? I think an auto-backup service, or to have the ability to set up such a service with a script and/or cron command, is a reasonable expectation to have of a webhost.
Logged
Tristan
Resident Alien
Administrator
Berserker Poster
*****
Offline Offline

Posts: 8937


nihil sunt omnia


WWW
« Reply #18 on: January 03, 2005, 08:13:09 AM »

Actually, you could simply request to be moved to an exec() enabled server since you require this functionality.  You'd just email support@lunarpages.com and provide your Cpanel username and the last 4 digits of your credit card on file with us (no charges apply) and note that you need to be transferred to an exec() capable server.
Logged

Tristan Wallace
- nihil sunt omnia -
Lunarpages Webhosting ~ Lunarpages Forums ~ Lunarpages Affiliates
Administrator Training Manager - System Administrator Team


Ruby Asylum - For those crazy about Ruby
A&E Writing Forum ~ Best Garden ~ Endar & Endar Gallery ~ RatingBar.com

Every living creature on this earth dies alone.
BlueTicona
Spaceship Navigator
*****
Offline Offline

Posts: 94


WWW
« Reply #19 on: January 03, 2005, 04:13:44 PM »

Quote from: Danielle
Blueticona, you're welcome, although I just posted it in the how-to section; the main kudos should go to scanman who created the scripts  Applause


walks around with his bag of kudos to give to various people[/i]

 Ner Ner   Thumbs Up
Logged

http://www.DreamTune.comThe Melody of Magic & New Age!

We are a support community for pagans and their Magical & New Age lifestyles. This community is meant to be a gathering place for everyone to get together and exchange information on various Paths, Teachings & Healings.
triscuit
Trekkie
**
Offline Offline

Posts: 12


« Reply #20 on: January 10, 2005, 08:51:07 PM »

I was wondering how I just compress the database into a zip file daily and let it sit on the server in the dir of my choosing.  Then a client on my computer will connect and download the zipped file daily.  I had this setup before but lunarpages erased my crontab because I had a process that was using too much cpu time.  This one got erased along with the resource hog and I would like to restore it.
Logged
scanman20
Master Jedi
*****
Offline Offline

Posts: 1251



WWW
« Reply #21 on: January 11, 2005, 06:04:22 AM »

Quote from: triscuit
I was wondering how I just compress the database into a zip file daily and let it sit on the server in the dir of my choosing.  Then a client on my computer will connect and download the zipped file daily.  I had this setup before but lunarpages erased my crontab because I had a process that was using too much cpu time.  This one got erased along with the resource hog and I would like to restore it.
Just use the MySQL backup via cron - Emailed to You script I wrote and comment out or delete the email section. It will leave the backup file in the folder where it was created, and overwrite it everytime the cron runs.
Logged

Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP
_silex
Intergalactic Superstar
*****
Offline Offline

Posts: 167



WWW
« Reply #22 on: January 12, 2005, 09:48:27 PM »

Scanman, great work and I needed a script like this to email me my backups.  I did have one that would archive them locally (Thanks to Lupus!), but this script is a definate must have.  Although I did run into a problem using the email script.  Trying to gzip all databases using --all-databases or -A doesn't work on Lunarpages?

Not sure why, but --all-databases won't work for me, although commenting out this line:
Code:
$dbname = "";   // Database name. Use --all-databases if you have more than one

And using this in $command works fine:
Code:
$command = "mysqldump -u $dbuser --password=$dbpwd --databases database1 database2 database3 | gzip > $filename";

Any reason why --all-databases won't work?
Logged

Blogcult : Free Blog & Journal Hosting
Chopsy666
Newbie
*
Offline Offline

Posts: 4


« Reply #23 on: January 18, 2005, 12:30:52 AM »

Hi,

If i wanted to have the backup emailed to 2 addresses do i just add the
mail($to, $subject, $content, $headers);  line twice and change the variables as appropriate

Thanks
          Nav
Logged
scanman20
Master Jedi
*****
Offline Offline

Posts: 1251



WWW
« Reply #24 on: January 18, 2005, 06:09:54 AM »

No, you would change the $to variable to a comma delimited list of addresses.  Thumbs Up
Logged

Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP
Ed
Berserker Poster
*****
Offline Offline

Posts: 5205



WWW
« Reply #25 on: January 18, 2005, 11:52:00 AM »

This is excellent! Many thanks Smile
Logged

Chopsy666
Newbie
*
Offline Offline

Posts: 4


« Reply #26 on: January 24, 2005, 02:44:10 AM »

Thanks for that scanman20,  i can't actually get the script working at all at the moment and it doesnt give men any error messages, but i will look into that before asking you for help Surprised

One other slightly related question, the file that is downloaded is a .gz file. winzip just extracts it to a single file. I have just started learning PHP & mysql so that i can support my own site fully rather than ask programmers. I would like to load my database onto my mysql prgram on my laptop, but i am not sure how as i was expecting lots of files such as .fyi (forgive me if that extention is wrong) that i could copy into the relative folder on my machine.  Any ideas?

Thanks
    Nav
Logged
Ed
Berserker Poster
*****
Offline Offline

Posts: 5205



WWW
« Reply #27 on: January 24, 2005, 06:03:53 AM »

The backup/dump file is actually just a large mySQL query that will recreate the data for you in your DB.

- Ed

Does anyone have any ideas on how to get this script to work if PHP safe mode is on and no access to passthru etc?
Logged

Chopsy666
Newbie
*
Offline Offline

Posts: 4


« Reply #28 on: January 25, 2005, 01:59:40 PM »

Hi,

I had lots of errors which were avoided by replacing // with /* & \\ with *\. However now the file that is emailed is called unnamed (outlook express quarantined it as unnamed.dat). When i upload it to my test server and go into phpadmin it says there are no tables so im not sure what i've made the script do, any ideas would be much appreciated.

Thanks
     Nav
Logged
mnemonik23
Trekkie
**
Offline Offline

Posts: 11


« Reply #29 on: February 04, 2005, 09:38:40 PM »

Hello,

I have a problem with site backup script:
I'm connected to the ftp - I see "Connected to my_server, for user my_user"

BUT $upload is not working: "FTP upload has failed."
And of course
Warning: unlink(/home/my_user/Full_Account_Backup-2005-02-04.tar.gz): No such file or directory in /home/my_user/public_html/backup/backup_site.php on line 56

Any suggestions would be greatly appreciated!
Logged
Pages: 1 [2] 3 4 ... 7   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM