Linux Domain Backup and MySQL backup

kalevra

Well-Known Member
Joined
Apr 2, 2009
Messages
478
Hey all...

I'm looking PHP based open source software that I can use to backup my domain and databases daily and have them back up/ zipped up ready to be downloaded for offsite backup.

We have linux hosting (everything is in the httpdocs folder) and use mysql databases (2 of them)

I looked into this a while ago and found nothing reliable enough and easy to install.

Anyone know of anything?
 

RSkeens

Expert Member
Joined
Jan 5, 2007
Messages
1,647
I would imagine the PHP script would require exec permissions, which would be a very big no - no for the web server. If you have shell access, you can specify a rsync to the remote backup server but then this obviously wouldn't be a PHP solution.

If your host has a control panel, you can usually find some kind of backup from there.
 

kalevra

Well-Known Member
Joined
Apr 2, 2009
Messages
478
I would imagine the PHP script would require exec permissions, which would be a very big no - no for the web server. If you have shell access, you can specify a rsync to the remote backup server but then this obviously wouldn't be a PHP solution.

If your host has a control panel, you can usually find some kind of backup from there.

found a brilliant solution here: http://omicronlab.com/forum/Backup-your-whole-website-in-zip-format-get-it-via-mailand33-t850.html

this will zip up your db and files, then split them up into 9MB per file and email them to a gmail account.... brilliant!! I'm busy testing but it does seem to work... Just have to increase memory in php.ini as it's failing on a specific operation.

As for the exec permissions the script runs a exec 'rm .... ' something or other to clear the contents of the tmp backup dir and i've checked that and it does clear it so I don't seem to have the problem you mentioned.

I just need to figure out how cronjobs work now :) haven't set one up before!

this is a life saver, lost our data last night and our host charges us R300 per hour for backup restoration... :mad:
 

RSkeens

Expert Member
Joined
Jan 5, 2007
Messages
1,647
this is a life saver, lost our data last night and our host charges us R300 per hour for backup restoration... :mad:

If I may ask, who was to blame for the loss of data? That is ridiculous they charge that per hour (unless it was not included in their services that you signed up with). Could be that they remove infections, etc then the price can be more justified.

As for the exec working - just be sure that no one uploads a PHP file that is malicious.

For cron jobs you will need to use SSH, your control panel or your host (be sure to not be charged for asking for it, as again that would just be silly to charge for that in my opinion).
 

kalevra

Well-Known Member
Joined
Apr 2, 2009
Messages
478
If I may ask, who was to blame for the loss of data? That is ridiculous they charge that per hour (unless it was not included in their services that you signed up with). Could be that they remove infections, etc then the price can be more justified.

As for the exec working - just be sure that no one uploads a PHP file that is malicious.

For cron jobs you will need to use SSH, your control panel or your host (be sure to not be charged for asking for it, as again that would just be silly to charge for that in my opinion).

i accidentally deleted some files I shouldn't have and the last backup I had was a month old :( ... I know I know... But I'm sorting it out now... Next time I'll just have to get the files from the backup gmail account and restore everything and it won't take 18 hours to do like the hosting co.

We have one option less than the most featured linux hosting option at webafrica so I'd say it's rather shocking they charge so much to restore our data never mind that it took them 18 hours to look at it even though I marked the support ticket as URGENT... oh well now it's done with minimal damage

I see a crontab option in the domains plesk back end, hopefully i can mess around in there and create the job to run the backup daily!

Thanks for your remarks, let me think of things I wouldn't of...
 

James

Expert Member
Joined
May 26, 2004
Messages
2,617
If you have exec permissions this should sort you out for db
Code:
exec('mysqldump --quick --opt -u xxx -pxxx DB > DB.out');

or (not 100% on this one)

Code:
exec ('mysqldump --quick --opt -u xxx -pxxx D | gzip > DBout.sql.gz');
 

kalevra

Well-Known Member
Joined
Apr 2, 2009
Messages
478
If you have exec permissions this should sort you out for db
Code:
exec('mysqldump --quick --opt -u xxx -pxxx DB > DB.out');

or (not 100% on this one)

Code:
exec ('mysqldump --quick --opt -u xxx -pxxx D | gzip > DBout.sql.gz');

Kewl... nice and easy 1 liner - perfect! :)
 

Other Pineapple Smurf

Honorary Master
Joined
Jun 21, 2008
Messages
14,593
Well you can also remotely connect to a db. I do this for my one site. That way I back it up directly to my PC.
 

James

Expert Member
Joined
May 26, 2004
Messages
2,617
Well you can also remotely connect to a db. I do this for my one site. That way I back it up directly to my PC.

Many hosts will lock this down and will only grant localhost permissions. And with dynamic IP's you would have to open a massive range of ips and then it is a security risk.
 

Other Pineapple Smurf

Honorary Master
Joined
Jun 21, 2008
Messages
14,593
Many hosts will lock this down and will only grant localhost permissions. And with dynamic IP's you would have to open a massive range of ips and then it is a security risk.

Just go to Cpanel and open up your current IP, once you are done, close it. Also you will see that you can predict your IP range after a while. That is what I have done.

Just add in a secure password.
 
Top