{"id":137,"date":"2012-11-08T15:16:41","date_gmt":"2012-11-08T15:16:41","guid":{"rendered":"http:\/\/cyber-cottage.co.uk\/en\/?p=137"},"modified":"2015-05-19T10:20:24","modified_gmt":"2015-05-19T10:20:24","slug":"backing-up-recordings-to-amazon-s3-from-elastix","status":"publish","type":"post","link":"https:\/\/www.cyber-cottage.co.uk\/?p=137","title":{"rendered":"Backing up to Amazon s3 from Elastix"},"content":{"rendered":"<p>We decided to do this as we have recently installed a new elastix server in the office which had limited disk space and wanted to keep offsite backups of recordings<\/p>\n<p><strong>s3cmd<\/strong>\u00a0is a command line client for copying files to\/from <a href=\"http:\/\/aws.amazon.com\/s3\/\" target=\"_blank\">Amazon S3<\/a> (Simple Storage Service) and performing other related tasks, for instance creating and removing buckets, listing objects, etc.<\/p>\n<h3>Install s3cmd<\/h3>\n<pre>wget http:\/\/sourceforge.net\/projects\/s3tools\/files\/s3cmd\/1.5.2\/s3cmd-1.5.2.tar.gz\r\n tar -xzvf s3cmd-1.1.0-beta3.tar.gz\r\n mkdir \/usr\/local\/s3cmd\/\r\n cd s3cmd-1.1.0-beta3\r\n cp -Rf * \/usr\/local\/s3cmd\/\r\n cd \/usr\/local\/s3cmd\/\r\n .\/s3cmd --configure<\/pre>\n<p>Follow the prompts and enter your keys.<\/p>\n<p>Test the installation<br \/>\n.\/s3cmd ls s3:\/\/yourbucket\/<\/p>\n<p>If the test works then the script below is a simple backup script to backup elastix monitor files and backups daily.<\/p>\n<p>vi \/etc\/cron.daily\/rec2s3c.sh<\/p>\n<pre>#!\/bin\/sh\r\n \/usr\/local\/s3cmd\/s3cmd --config=\/some\/where\/.s3cfg\u00a0sync \/var\/spool\/asterisk\/monitor s3:\/\/yourbucket\r\n \/bin\/rm -f \/var\/spool\/asterisk\/monitor\/*.gsm\r\n \/bin\/rm -f \/var\/spool\/asterisk\/monitor\/*.wav\r\n \/usr\/local\/s3cmd\/s3cmd --config=\/some\/where\/.s3cfg\u00a0ls s3:\/\/yourbucket\/monitor\/ &gt; \/var\/log\/s3dirlist.log\r\n \/usr\/local\/s3cmd\/s3cmd --config=\/some\/where\/.s3cfg\u00a0sync \/var\/www\/backup s3:\/\/yourbucket\r\n \/usr\/local\/s3cmd\/s3cmd --config=\/some\/where\/.s3cfg\u00a0ls s3:\/\/yourbucket\/backup\/ &gt;&gt; \/var\/log\/s3dirlist.log<\/pre>\n<p>&nbsp;<\/p>\n<p>enjoy :-)<\/p>\n<p>For more details of what can be done with s3cmd see\u00a0<a href=\"http:\/\/linux.die.net\/man\/1\/s3cmd\" target=\"_blank\">http:\/\/linux.die.net\/man\/1\/s3cmd<\/a>\u00a0and\u00a0<a href=\"http:\/\/aws.amazon.com\/s3\/\" target=\"_blank\">http:\/\/aws.amazon.com\/s3\/<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We decided to do this as we have recently installed a new elastix server in the office which had limited disk space and wanted to keep offsite backups of recordings s3cmd\u00a0is a command line client for copying files to\/from Amazon S3 (Simple Storage Service) and performing other related tasks, for instance creating and removing buckets, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[88,89,11],"tags":[],"class_list":["post-137","post","type-post","status-publish","format-standard","hentry","category-astsupport","category-elxsupport","category-knowledge"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p5daZy-2d","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=137"}],"version-history":[{"count":4,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":1514,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/137\/revisions\/1514"}],"wp:attachment":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}