Configuration Steps
Prerequisites
- S3 bucket
- IAM credentials
- bareos-storage-droplet package
Step 1: Installation
Install Backend: Install the bareos-storage-droplet package from the official Bareos repositories.
thushara@server:/etc/bareos$ sudo apt install bareos-storage-dropletReading package lists... DoneBuilding dependency tree... DoneReading state information... DoneThe following NEW packages will be installed:bareos-storage-droplet0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Step 2: Director Configuration
Define a Storage resource in the Bareos Director (e.g., /etc/bareos/bareos-dir.d/storage/s3.conf) and specify a dedicated Media Type.
root@BAT-NUC:/etc/bareos# cat /etc/bareos/bareos-dir.d/storage/s3.confStorage { Name = s3_Bareos Address = BAT-NUC Password = "abcdefghijklmnopqrstuvwxyz" Device = "s3_dev1" Device = "s3_dev2" Media Type = "s3_object1" Maximum Concurrent Jobs = 2 # equals the number of devices}
Storage { Name = s3_Bareos Address = BAT-NUC Password = "abcdefghijklmnopqrstuvwxyz" Device = "s3_dev3" Device = "s3_dev4" Media Type = "s3_object2" Maximum Concurrent Jobs = 2 # equals the number of devices}
root@BAT-NUC:/etc/bareos# cat /etc/bareos/bareos-dir.d/storage/s3.confStorage {Name = s3_BareosAddress = BAT-NUCPassword = "abcdefghijklmnopqrstuvwxyz"Device = "s3_dev1"Device = "s3_dev2"Media Type = "s3_object1"Maximum Concurrent Jobs = 2 # equals the number of devices}Storage {Name = s3_BareosAddress = BAT-NUCPassword = "abcdefghijklmnopqrstuvwxyz"Device = "s3_dev3"Device = "s3_dev4"Media Type = "s3_object2"Maximum Concurrent Jobs = 2 # equals the number of devices}
Step 3: Storage Daemon Configuration
Create a Device resource in the Storage Daemon pointing to the droplet backend
root@BAT-NUC:/etc/bareos# cat /etc/bareos/bareos-sd.d/device/s3.conf
Device {
Name = "s3_dev1"
Media Type = "s3_object1"
Archive Device = S3 Object Storage
Device Options = "profile=/etc/bareos/bareos-sd.d/device/droplet/s3.profile,bucket=my-backup-data,chunksize=100M"
Device Type = droplet
Label Media = yes
Random Access = yes
Automatic Mount = yes
Removable Media = no
Always Open = no
Description = "s3 device"
Maximum Concurrent Jobs = 1
}
Device {
Name = "s3_dev2"
Media Type = "s3_object1"
Archive Device = S3 Object Storage
Device Options = "profile=/etc/bareos/bareos-sd.d/device/droplet/s3.profile,bucket=my-backup-data,chunksize=100M"
Device Type = droplet
Label Media = yes
Random Access = yes
Automatic Mount = yes
Removable Media = no
Always Open = no
Description = "s3 device"
Maximum Concurrent Jobs = 1
}
Device {
Name = "s3_dev3"
Media Type = "s3_object2"
Archive Device = S3 Object Storage
Device Options = "profile=/etc/bareos/bareos-sd.d/device/droplet/s3.profile,bucket=my-backup-data,chunksize=100M"
Device Type = droplet
Label Media = yes
Random Access = yes
Automatic Mount = yes
Removable Media = no
Always Open = no
Description = "s3 device"
Maximum Concurrent Jobs = 1
}
Device {
Name = "s3_dev4"
Media Type = "s3_object2"
Archive Device = S3 Object Storage
Device Options = "profile=/etc/bareos/bareos-sd.d/device/droplet/s3.profile,bucket=my-backup-data,chunksize=100M"
Device Type = droplet
Label Media = yes
Random Access = yes
Automatic Mount = yes
Removable Media = no
Always Open = no
Description = "s3 device"
Maximum Concurrent Jobs = 1
}
Step 4: S3 Credentials Profile:
Step 4: S3 Credentials Profile:
Create a droplet profile (e.g., /etc/bareos/bareos-sd.d/device/droplet/s3.profile) containing your IAM access keys, secret keys, and region..
root@BAT-NUC:/etc/bareos# cat /etc/bareos/bareos-sd.d/device/droplet/s3.profileaws_region = ap-southeast-2access_key = "abcdefghijklmnopqrstuvwxyz"secret_key = "abcdefghijklmnopqrstuvwxyz"host = s3.ap-southeast-2.amazonaws.com:443use_https = truebackend = s3aws_auth_sign_version = 2pricing_dir = ""
To test an AWS S3 connection from PowerShell using the AWS CLI and Security Token Service (STS), follow these steps:
- Use the aws configure command to set up your access keys, secret key, and default region.
- Run the aws sts get-caller-identity command to confirm that your credentials are valid and active. This returns your Account ID, UserId, and ARN.
- Test S3 Connection, aws s3 ls To verify actual connectivity and permissions to S3, list your buckets.
- Test Access to a Specific Bucket If you only have permission for a single bucket, listing all buckets might fail even with a valid key. Instead, try listing the contents of that specific bucket: aws s3 ls s3://your-bucket-name
- To copy a file manually to Amazon S3 using PowerShell, you can use aws s3 cp "C:\path\to\yourfile.txt" s3://your-bucket-name/
Install or update the AWS CLI: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
Please run this command on bconsole see connection is working
status storage=s3_Bareos
If it's working output should be as bellow
Connecting to Storage daemon s3_Bareos at 10.3.1.1:9103
Job inventory:
No Jobs running.
Device status:Device "s3_dev1" (S3) is not open.Backend connection is working.No pending IO flush requests.==Device "s3_dev2" (S3) is not open.Backend connection is working.No pending IO flush requests
Step 4: link your Pool
To finish the setup, you need to link your Pool resource to the specific Storage:
In your Bareos director configuration (usually under /etc/bareos/bareos-dir.d/pool/), add the Storage directive.
In this setup differential and incremental backups will continue to be stored in the local folder on the file server, while monthly full backups will now be directed to AWS S3.
/etc/bareos/bareos-dir.d/pool/Full.conf
Pool {Name = FullPool Type = BackupStorage = s3_BareosRecycle = yes # Bareos can automatically recycle VolumesAutoPrune = yes # Prune expired volumesVolume Retention = 7 days # How long should the Full Backups be kept?Maximum Volume Bytes = 100G # Limit Volume size to something reasonableMaximum Volumes = 11 # Limit number of Volumes in PoolLabel Format = "Full-" # Volumes will be labeled "Full-<volume-id>"Recycle Oldest Volume = yes #prune the oldest volume in the Pool, and if all files were pruned, recycle this volume and use it.Purge Oldest Volume = yes #permits a forced recycling of the oldest Volume when a new one is needed.}
--
root@BAT-NUC:/etc/bareos# cat /etc/bareos/bareos-dir.d/pool/Incremental.confPool {Name = IncrementalPool Type = BackupStorage = FileRecycle = yes # Bareos can automatically recycle VolumesAutoPrune = yes # Prune expired volumesVolume Retention = 4 days # How long should the Incremental Backups be kept?Maximum Volume Bytes = 100G # Limit Volume size to something reasonableMaximum Volumes = 10 # Limit number of Volumes in PoolLabel Format = "Incremental-" # Volumes will be labeled "Incremental-<volume-id>"Recycle Oldest Volume = yesPurge Oldest Volume = yes #permits a forced recycling of the oldest Volume when a new one is needed.}root@BAT-NUC:/etc/bareos# cat /etc/bareos/bareos-dir.d/pool/Differential.confPool {Name = DifferentialPool Type = BackupStorage = FileRecycle = yes # Bareos can automatically recycle VolumesAutoPrune = yes # Prune expired volumesVolume Retention = 5 days # How long should the Differential Backups be kept?Maximum Volume Bytes = 100G # Limit Volume size to something reasonableMaximum Volumes = 10 # Limit number of Volumes in PoolLabel Format = "Differential-" # Volumes will be labeled "Differential-<volume-id>"Purge Oldest Volume = yes #permits a forced recycling of the oldest Volume when a new one is needed.Purge Oldest Volume = yes #permits a forced recycling of the oldest Volume when a new one is needed.--









