| User | Post |
|
4:52 pm February 20, 2012
| John
| | |
| Member | posts 3 | |
|
|
I am using xcloner to backup my website to the local server, then have the backup copied to an Amazon S3 account. Works great!
However, even though xcloner cleans up older backups on the local server, it appears it does not clean up backups from the Amazon S3 account.
Is there a way to get xcloner to perform clean up on the Amazon S3 account automatically?
Thank you,
jhannan
|
|
|
6:10 pm February 20, 2012
| XCloner! Support
| | |
| Admin
| posts 1362 | 
|
|
|
At the moment, XCloner does not have that functionality built in, but it is on the dev list for a future version.
If you like to add it yourself, the code to edit is inside the cloner.cron.php file, and the amazon php class in classes/S3.php
Regards, Ovidiu
|
|
|
|
|
7:26 pm February 21, 2012
| John
| | |
| Member | posts 3 | |
|
|
Thank you for the response. Any chance you would have an example of the command line syntax to use? I have no idea how to word the command, what to call. Perhaps you can provide an example of sending a file delete command?
Thank you,
jhannan
|
|
|
8:22 am February 22, 2012
| XCloner! Support
| | |
| Admin
| posts 1362 | 
|
|
|
You will need to use the following method as defined in the S3 class
/**
* Delete an object
*
* @param string $bucket Bucket name
* @param string $uri Object URI
* @return boolean
*/
public static function deleteObject($bucket, $uri) {
$rest = new S3Request('DELETE', $bucket, $uri);
$rest = $rest->getResponse();
if ($rest->error === false && $rest->code !== 204)
$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
if ($rest->error !== false) {
trigger_error(sprintf("S3::deleteObject(): [%s] %s",
$rest->error['code'], $rest->error['message']), E_USER_WARNING);
return false;
}
return true;
}
so when calling it from the cloner.cron.ph you would use
$s3->$deleteObject($_CONFIG['cron_amazon_bucket'], $_CONFIG['cron_amazon_dirname']."/".baseName($file)) Hope it helps
|
|
|
|
|
9:14 pm February 22, 2012
| John
| | |
| Member | posts 3 | |
|
|
Thanks for the quick response! Great support!
We are going to try this out and see if we can get it working.
Appreciate the help! 
|
|