Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

Tips for backing up to Amazon's S3 Service

General questions about VestaCP
Post Reply
  • Print view
Advanced search
11 posts
  • 1
  • 2
  • Next
missionaryman
Posts: 50
Joined: Mon Oct 27, 2014 10:04 am

Tips for backing up to Amazon's S3 Service
  • Quote

Post by missionaryman » Tue Jul 28, 2015 6:36 pm

Hi all,

I love this forum! I find loads of answers here, and people are pretty-good at answering my (sometimes dumb) questions, so I thought I'd share back with something I've learned recently. How to backup your backups to Amazon's S3:

1) Obviously, get yourself an S3 account (free for the first year!) and get your Access Key Id and Access Key. Click here for more details: http://aws.amazon.com/
2) On S3, make a unique bucket (folder) name for your backups. For this example, I'll call mine vesta-backups.
3) Install s3cmd (website here: http://s3tools.org/s3cmd) on your server. I use Ubuntu, so the command is sudo apt-get install s3cmd.
REALLY IMPORTANT PART:
4) You'll need to configure s3cmd so that it works with the VestaCP admin account. Either make sure you've SSHed in to your server as admin, or su admin to ensure you're configuring the right user. VestaCP turns off SSH access for admin by default, so be sure to edit the admin user settings to allow SSH access, even if just for this operation. If you configure the wrong user, the backup process will not work. Be warned!
5) type s3cmd --configure and enter all the requested details. You'll need to enter your S3 credentials and these are long! use <shift><insert> to paste into a terminal window.
6) s3cmd will test the connection and confirm success.
7) In /home/admin, create the following file: cron-s3sync.txt and past the following in:

Code: Select all

# SYNC FILES
#!/bin/bash
s3cmd sync  --delete-removed -m "application/x-tar" /home/backup/ s3://vesta-backups/ >/dev/null 2>&1
8) Obviously, make sure the s3://vesta-backups is the name of your created S3 bucket. All the code from > onwards stops any reporting. Remove this and you'll receive emails regarding the process, either success or failure.
9) change the attributes of the cron-sync.txt to allow file execution: chmod 755 cron-sync.txt
10) Finally, create a CRON job in VestaCP that points to /home/admin/cron-s3sync.txt

When testing, remove the code from > to allow email reporting on success or failure, then change the CRON time to your current time +1 minute and check that everything backs up correctly. The actual code syncs the backup folder on VestaCP with S3 rather than just adding the latest backup. If you wanted different functionality, I'm sure you can figure it out.

Hope that helps!

Adam
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Tips for backing up to Amazon's S3 Service
  • Quote

Post by skurudo » Wed Jul 29, 2015 2:08 pm

Nice manual, good work! ;-)

I have indiscreet intimate question - how much is the fish? ;-) In reality how much s3 cost for user? xxx gb = price.
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: Tips for backing up to Amazon's S3 Service
  • Quote

Post by tjebbeke » Thu Jul 30, 2015 7:29 am

skurudo wrote:Nice manual, good work! ;-)

I have indiscreet intimate question - how much is the fish? ;-) In reality how much s3 cost for user? xxx gb = price.
http://aws.amazon.com/s3/pricing/

0.01$ - 0.03$ /GB /month
Top

missionaryman
Posts: 50
Joined: Mon Oct 27, 2014 10:04 am

Re: Tips for backing up to Amazon's S3 Service
  • Quote

Post by missionaryman » Thu Jul 30, 2015 8:54 am

From http://aws.amazon.com/s3/pricing/
AWS Free Usage Tier*

As part of the AWS Free Usage Tier, you can get started with Amazon S3 for free. Upon sign-up, new AWS customers receive 5 GB of Amazon S3 standard storage, 20,000 Get Requests, 2,000 Put Requests, and 15GB of data transfer out each month for one year.
Top

pandabb
Posts: 192
Joined: Sat Aug 08, 2015 3:03 am

Re: Tips for backing up to Amazon's S3 Service
  • Quote

Post by pandabb » Sat Aug 08, 2015 9:54 am

Hello Sir, Thanks for this tutorial.

What if i want to backup multiple different users? My Admin account has no webdomains i created seperate users for each domain.
Top

missionaryman
Posts: 50
Joined: Mon Oct 27, 2014 10:04 am

Re: Tips for backing up to Amazon's S3 Service
  • Quote

Post by missionaryman » Sat Aug 08, 2015 9:57 am

This tutorial shows you how to copy the VestaCP backups generated by the control panel to Amazon's S3 service. It doesn't cover how to configure the VestaCP backup service.
Top

hafeezksa
Posts: 81
Joined: Mon Apr 27, 2015 5:45 pm
Contact:
Contact hafeezksa
Website

Re: Tips for backing up to Amazon's S3 Service
  • Quote

Post by hafeezksa » Sat Aug 08, 2015 12:21 pm

Is there way to keep backup to Dropbox?
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Tips for backing up to Amazon's S3 Service
  • Quote

Post by skurudo » Tue Aug 11, 2015 9:04 am

hafeezksa wrote:Is there way to keep backup to Dropbox?
There is a way:
http://buildcontext.com/blog/2012/dropb ... ctive-sync
http://www.howopensource.com/2014/09/si ... o-dropbox/

Official guide:
http://www.dropboxwiki.com/tips-and-tri ... erface-cli
Top

asixja
Posts: 4
Joined: Sun Jan 31, 2016 10:40 am

Re: Tips for backing up to Amazon's S3 Service
  • Quote

Post by asixja » Sun Feb 07, 2016 1:06 pm

One question.
I have successfully installed all the s3.
I have to put in the SSH panel controls as follows:

Code: Select all

s3cmd sync --recursive/home/backup/ s3://vesta-backup
successfully migrate files on Amazon

I tried to add s3cmd Cronn direct command

Code: Select all

s3cmd sync --recursive/home/backup/ s3://vesta-backup
and I put refresh every minute (that I tested)

And then the email I keep getting this error:

Code: Select all

ERROR: /home/admin/.s3cfg: None
ERROR: Configuration file not available.
ERROR: Consider using --configure parameter to create one.
I tried to create a file according to your instructions "cron-s3sync.txt" and I put it in the /home/admin/ and in Cron put this

Code: Select all

/home/admin/cron-s3sync.txt
But then I get the same error:

Code: Select all

ERROR: /home/admin/.s3cfg: None
ERROR: Configuration file not available.
ERROR: Consider using --configure parameter to create one.
I tried that and I bet .s3cfg directly to "/home/admin/" but then does not work Cron

What do you suggest to me?
Top

Nacho
Posts: 5
Joined: Wed Oct 29, 2014 1:39 pm

Re: Tips for backing up to Amazon's S3 Service
  • Quote

Post by Nacho » Thu Jan 12, 2017 5:04 pm

Hi guys, do you have info about backups to amazon glacier, supposed to be a lot cheaper and now you can get files quicker than before. Thanks in advance.
Top


Post Reply
  • Print view

11 posts
  • 1
  • 2
  • Next

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password