tags:

views:

28

answers:

1

Hey,

I was wondering how to use php to do an auto transfer of log files weekly from one server to a cloud account.

I have all the passwords and what not, I am just confused on how to set this file up. As a site I am running stores log files, we are trying to "push" them weekly to our cloud storage.

Any help would be appreciated.

A: 

Depending on your platform (Windows, *Nix), you would just want to use some scheduling system to invoke the PHP job either directly or via a local web call.

cron would be your *Nix tool of choice A scheduled task in windows would work there.

Outside of that, you'd just need to use PHP's file classes, specifically copy, and whatever code you'd need for your cloud provider.

EDIT: examples for RackSpace api

These guys have done basically exactly what you need. http://clloud.com/tutorials-and-tips/uploading-files-to-rackspace-cloud-using-php-aka-mosso/

I would build an upload script from that knowledge that does what you want. Then just use cron or scheduled task to invoke it on your schedule

Taylor
Cool.. I guess I was more confused of really how to set this all up. I appreciate the patience and putting up with my somewhat lack of knowledge.
Louis Stephens
Thank you Taylor, I was just wondering though, I followed his tutorial, and it all works except I am supposed to fill in a "container" and I have no clue what this is lol.
Louis Stephens
I don't use Rackspace, so I'm not 100% of their implementation. In most cloud storage spaces they provide a construct basically like a folder on a hard drive, and this is called a container. I would log into your rackspace account and look around for options to manage or create containers. Worse case, search their help for how to create a container. Then you just take that name and use it in the script.
Taylor
Thanks.. I got the container set.. Ugh, still errors
Louis Stephens