FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Automated server-to-server backup






Possible?
Easy!
0%
 0%  [ 0 ]
Maybe, but way beyond your skill
50%
 50%  [ 1 ]
Never
0%
 0%  [ 0 ]
Destabilization
50%
 50%  [ 1 ]
Total Votes : 2

ocalhoun
Is making a script for accomplishing a server-to-server backup possible?
I want to regularly copy everything (including databases would be good) in my Frihost web space onto a server I pay for, as a backup. The trick is that I want to make it automated, and I don't want it to have to go through the very slow connection to my PC; I want to go directly from server to server, for a quick high-speed backup.

Is it possible to make (or find) a script to do this? If so, how?
I don't even know the basics of it...
Which server would the script run on?
What language would it use (php hopefully)?
What transfer protocol(s) would it use?
What basic commands would be used by the script for transferring files?

Any help would be great; I've never done a server-to-server connection with php, or anything else that I remember. I don't even know if that is possible. Somehow, the script on one server has to log into the other server, right?
rvec
it is possible Smile

I made a script to download files over php a couple of weeks ago, you can use part of that. For the database you should allow access from the backup server to the database (should be some setting in directadmin/cpanel), and just make a php script to backup what you want to backup. Then put the ftp and database stuff in one script (probably easiest with a require()) and run the script with cron.

I was actually waiting for polly-gone to do the design of the ftp script, but I'll just put it online and change it when polly-gone is done.
leontius
There is an FTP extension called FXP which enable ftpserver-to-ftpserver direct transfer (both ftp server must support FXP protocol). That would be just what you're looking for right? Also if you own the server or has ssh access to the server, it would be very easy to set up rsync to copy from one server to another.

If you want to code something yourself, remember that your website data can be compromised if you do not add an encryption layer.
rvec
leontius wrote:
There is an FTP extension called FXP which enable ftpserver-to-ftpserver direct transfer (both ftp server must support FXP protocol). That would be just what you're looking for right? Also if you own the server or has ssh access to the server, it would be very easy to set up rsync to copy from one server to another.

If you want to code something yourself, remember that your website data can be compromised if you do not add an encryption layer.

You think website data can be compromised when send over unencrypted ftp? Almost everyone uses unencrypted ftp and even worse the direct-admin upload function.

Also the password you enter when logging in on any phpbb forum is not encrypted (normally) and the same for a lot of other login forms.

My script to transfer files over ftp:
http://www.bierkip.nl/test/ftp/s2sFTP.zip
The design is just not 100% done. But if you're going to use cron you don't need a design anyway. You should use the class and maybe use parts of the rest to write your own version with the links and stuff hard-coded in it.
pawelabrams
It is possible, with script exporting database (there is something like that on the net, even not in phpMyAdmin Razz ) and function "cp()" described in this subject: http://www.frihost.com/forums/vt-96135.html
rvec
pawelabrams wrote:
It is possible, with script exporting database (there is something like that on the net, even not in phpMyAdmin Razz ) and function "cp()" described in this subject: http://www.frihost.com/forums/vt-96135.html
doesn't work, cp() will not get php files.

and "script exporting database" Confused I'd just write a script to get a complete database (or the parts you need). Writing that wouldn't take more than 300 lines I think.
Related topics
script backup database
Cant Backup in phpbb
Best FTP Client on EARTH
Mysql database size?
How to get backup from server to my computer
Damn!!! Severe and LOngest DownTime i ever had!!
Mail Server
Server for Backup
Server 2 Unusually Slow Today + Serving Blank Pages.
backup data on remote server
Please Help Me....
Any fast way to transfer/backup a domain to another server?
Who Here Uses Joomla?
domain name switching for server backup
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.