Jump to content

Amazon Backup


isimpledesign

Recommended Posts

Hi

 

This is a really basic question but i am trying to understand the process of uploading to amazon S3, I dont want to just download a pre-wriiten script that i dont understand whats happen.

 

I am using the s3.php class

 

require_once('S3.php');

$s3 = new S3('[EDITED]', '[EDITED]');

$ourFileName = "files/test.txt";
$ourFileHandle = fopen($ourFileName, 'r') or die("can't open file");
fclose($ourFileHandle);

if ($s3->putObjectFile("files/test.txt", "mybucket", "test/test.txt", S3::ACL_PUBLIC_READ)) {
               echo "<strong>We successfully uploaded your file.</strong>";
}else{
               echo "<strong>Something went wrong while uploading your file... sorry.</strong>";
}

 

Ok so i am just doing this to figure it out, so i create a file and then upload to amazon s3 this works fine, where i am confused is when you backup all files and directories in a site, i dont want all the backup files in the root off my website i want them to automatically upload to amazon.

 

So how does the process work?

if i upload a file it works great but i am still upload a file form my server.

 

How does amazon automatically grab files from my server and upload them.

 

Anyone no any basic step by step tutorials i have googled loads but they are all massive pre written classes and stuff which i can get working, but looking for a basic example.

 

Thanks

Link to comment
Share on other sites

 

Do it add the backup files to a temperary folder then upload to amazon

Hi

 

This is a really basic question but i am trying to understand the process of uploading to amazon S3, I dont want to just download a pre-wriiten script that i dont understand whats happen.

 

I am using the s3.php class

 

require_once('S3.php');

$s3 = new S3('key', 'key+key');

$ourFileName = "files/test.txt";
$ourFileHandle = fopen($ourFileName, 'r') or die("can't open file");
fclose($ourFileHandle);

if ($s3->putObjectFile("files/test.txt", "mybucket", "test/test.txt", S3::ACL_PUBLIC_READ)) {
				echo "<strong>We successfully uploaded your file.</strong>";
}else{
				echo "<strong>Something went wrong while uploading your file... sorry.</strong>";
}

 

Ok so i am just doing this to figure it out, so i create a file and then upload to amazon s3 this works fine, where i am confused is when you backup all files and directories in a site, i dont want all the backup files in the root off my website i want them to automatically upload to amazon.

 

So how does the process work?

if i upload a file it works great but i am still upload a file form my server.

 

How does amazon automatically grab files from my server and upload them.

 

Anyone no any basic step by step tutorials i have googled loads but they are all massive pre written classes and stuff which i can get working, but looking for a basic example.

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.