How to configure S3 bucket backup

1. On senhasegura is possible to do backup on AWS bucket (S3). Configure the aws with the command below:

aws configure

2. Insert the required information:

a- AWS Access Key ID (must);
b- AWS Secret Access Key (must);
c- Default region-name. If not informed, to default is the AWS server region.
d- Default output format [json]: json

IMPORTANT: ATTENTION ON VARIABLES BETWEEN {}. IT MUST CHANGE TO REAL VALUE.

3- Run the command to configure the S3:

aws s3 sync /var/orbini/backup/senhasegura s3://{your_bucket_name}/{your_folder_name}

Exemple:

aws s3 sync /var/orbini/backup/senhasegura s3://backupSenhasegura/Master

4- Create the cron to it:

vim /etc/cron.d/aws_sync

5- To avoid queuing processes, change the time parameter to 25, as instructed below

*/25 * * * * root /usr/local/bin/aws s3 sync /srv/backup_remoto/ s3://{your_bucket_name}/{your_folder_name}/ 2> /dev/null 1>/dev/null

6- Restart the cron service.

systemctl restart cron

1 Like