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
https://forums.phpfreaks.com/topic/223672-amazon-backup/
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
https://forums.phpfreaks.com/topic/223672-amazon-backup/#findComment-1156205
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.