473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

mirroring files and data via http

I'm working on a project to create a central administration interface
for several websites located on different physical servers.

You can think of the websites as a blog type application. My
administration application will be used to create new blog posts with
associated media (images, etc..)

So I am thinking to setting up a script on each of the sites to "phone
home" once per day and download any new posts and media files.

I am thinking of transmitting the post data in an xml format that
could then be decoded an recorded into the database on the slave
site. Are there any easy ways to encode a python dictionary to and
from xml?

For the media files I am thinking that the administration interface
would also provide an xml file with a list of all of the media files
required along with an http path to retrieve them and a checksum of
some sort to verify that they were downloaded correctly.

Basically I am trying to figure out if anything already exists to
perform some of these functions or if I have to make them from
scratch. I know none of it should be too hard, but I hate to re-
invent the wheel.

Thanks,

Steven Potter
Jul 7 '08 #1
3 1055
Steve Potter wrote:
I'm working on a project to create a central administration interface
for several websites located on different physical servers.

You can think of the websites as a blog type application. My
administration application will be used to create new blog posts with
associated media (images, etc..)

So I am thinking to setting up a script on each of the sites to "phone
home" once per day and download any new posts and media files.

I am thinking of transmitting the post data in an xml format that
could then be decoded an recorded into the database on the slave
site. Are there any easy ways to encode a python dictionary to and
from xml?

For the media files I am thinking that the administration interface
would also provide an xml file with a list of all of the media files
required along with an http path to retrieve them and a checksum of
some sort to verify that they were downloaded correctly.

Basically I am trying to figure out if anything already exists to
perform some of these functions or if I have to make them from
scratch. I know none of it should be too hard, but I hate to re-
invent the wheel.

Thanks,

Steven Potter
It sounds like JSON would be perfect for this. For working with it in
Python, the simplejson module is popular:

<http://pypi.python.org/pypi/simplejson>
--
Jul 7 '08 #2
On Jul 6, 8:19 pm, Matt Nordhoff <mnordh...@mattnordhoff.comwrote:
Steve Potter wrote:
I'm working on a project to create a central administration interface
for several websites located on different physical servers.
You can think of the websites as a blog type application. My
administration application will be used to create new blog posts with
associated media (images, etc..)
So I am thinking to setting up a script on each of the sites to "phone
home" once per day and download any new posts and media files.
I am thinking of transmitting the post data in an xml format that
could then be decoded an recorded into the database on the slave
site. Are there any easy ways to encode a python dictionary to and
from xml?
For the media files I am thinking that the administration interface
would also provide an xml file with a list of all of the media files
required along with an http path to retrieve them and a checksum of
some sort to verify that they were downloaded correctly.
Basically I am trying to figure out if anything already exists to
perform some of these functions or if I have to make them from
scratch. I know none of it should be too hard, but I hate to re-
invent the wheel.
Thanks,
Steven Potter

It sounds like JSON would be perfect for this. For working with it in
Python, the simplejson module is popular:

<http://pypi.python.org/pypi/simplejson>
--
Matt,

You are correct JSON would be much easier to deal with than xml. That
takes care of several of the problems.

Now it really just comes down to the file transfer from one server to
the other and a verification of some sort that the file transfer was
not corrupt. Is there a python module that takes care of file
downloads and verification?

Thanks,

Steve
Jul 7 '08 #3
Steve Potter wrote:
On Jul 6, 8:19 pm, Matt Nordhoff <mnordh...@mattnordhoff.comwrote:
>Steve Potter wrote:
>>I'm working on a project to create a central administration interface
for several websites located on different physical servers.
You can think of the websites as a blog type application. My
administration application will be used to create new blog posts with
associated media (images, etc..)
So I am thinking to setting up a script on each of the sites to "phone
home" once per day and download any new posts and media files.
I am thinking of transmitting the post data in an xml format that
could then be decoded an recorded into the database on the slave
site. Are there any easy ways to encode a python dictionary to and
from xml?
For the media files I am thinking that the administration interface
would also provide an xml file with a list of all of the media files
required along with an http path to retrieve them and a checksum of
some sort to verify that they were downloaded correctly.
Basically I am trying to figure out if anything already exists to
perform some of these functions or if I have to make them from
scratch. I know none of it should be too hard, but I hate to re-
invent the wheel.
Thanks,
Steven Potter
It sounds like JSON would be perfect for this. For working with it in
Python, the simplejson module is popular:

<http://pypi.python.org/pypi/simplejson>
--

Matt,

You are correct JSON would be much easier to deal with than xml. That
takes care of several of the problems.

Now it really just comes down to the file transfer from one server to
the other and a verification of some sort that the file transfer was
not corrupt. Is there a python module that takes care of file
downloads and verification?

Thanks,

Steve
Not automatically, but this should be easy to do yourself. You could
generate a simple JSON or plain text file listing URLs and hashes, and
then use urllib or urllib2 to download them, and md5, sha1 or (in Python
2.5) hashlib to verify them. All of those modules are in the standard
library.
--
Jul 7 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: hrishy | last post by:
Hi All I was just wundering is there any way of mirroring our active logs just in case of disk failures.wil db2 do it automatically for us maybe through some inititalisation parameter. ...
6
by: GGerard | last post by:
Hello Does anyone know if there's a way to mirror data from a backend database to a second database? Example: When writing data to one database it would mirror the data in a second database...
4
by: Steve | last post by:
Hi, I've been running postgres on my server for over a year now and the tables have become huge. I have 3 tables that have data over 10GB each and these tables are read very very frequently. In...
4
by: Glen Eustace | last post by:
I thought I had seen something that indicated that v8 was going to provide a means to mirror databases without needing all the triggers etc. I downloaded beta 3 but couldn't see anything that would...
5
by: Ryan | last post by:
I'm devlving into 2005 and specifically mirroring. Having read the following article ( http://www.microsoft.com/technet/prodtechnol/sql/2005/dbmirror.mspx ), is mirroring a sensible option as it...
5
by: d.grabov | last post by:
Can anyone offer some advice on how to reduce the size of a database log. The database is mirrored on another server using the logs. Thanks
0
by: umeshpotdar | last post by:
i am doing mirroring on the data base i have done every step but i got problem below "Database Mirroring Transport is disabled in the endpoint configuration." this problem occured when i...
5
by: bosko19 | last post by:
We have recently set up two SQL Server 2005 Standard Edition servers with database mirroring. The mirrors function and fail over without a problem, but the Database Mirroring Monitor Job fails...
2
by: cmrhema | last post by:
Hi, All I underwent the following Steps for creating a mirror in sql server 2005. 1. Downloaded and isntalled sp2 in principal,mirror as well as witness servers 2. Created a new database named...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.