Backup and restore for PostgreSQL + why number of backups increased while we limit the recovery window of 7 days We are using the barman for PostgreSQL backup and restore on rhel 7.2 machines 

In the barman configuration file - /etc/barman.conf we set the following

retention_policy_mode = auto
retention_policy = RECOVERY WINDOW OF 7 days


But when we go to the folder that hold all the barman backups we see more then 30 backup folders

Note - from barman.conf we set barman_home = /barman

pwd
/barman/main-db-server/base
drwxr-xr-x 3 barman barman 4096 2020 20200218T204628
drwxr-xr-x 3 barman barman 4096 2020 20200218T204702
drwxr-xr-x 3 barman barman 4096 2020 20200218T204802
drwxr-xr-x 3 barman barman 4096 2020 20200218T204901
drwxr-xr-x 3 barman barman 4096 2020 20200218T205002
drwxr-xr-x 3 barman barman 4096 2020 20200218T205102
drwxr-xr-x 3 barman barman 4096 2020 20200218T205202
drwxr-xr-x 3 barman barman 4096 2020 20200218T205302
drwxr-xr-x 3 barman barman 4096 2020 20200218T205402
drwxr-xr-x 3 barman barman 4096 2020 20200218T205502
drwxr-xr-x 3 barman barman 4096 2020 20200218T205602
drwxr-xr-x 3 barman barman 4096 2020 20200218T205702
drwxr-xr-x 3 barman barman 4096 2020 20200218T205802
drwxr-xr-x 3 barman barman 4096 2020 20200218T205902
drwxr-xr-x 3 barman barman 4096 2020 20200218T210002
drwxr-xr-x 3 barman barman 4096 2020 20200218T210102
drwxr-xr-x 3 barman barman 4096 2020 20200218T210202
drwxr-xr-x 3 barman barman 4096 2020 20200218T210302
drwxr-xr-x 3 barman barman 4096 2020 20200218T210402
drwxr-xr-x 3 barman barman 4096 2020 20200218T210502
drwxr-xr-x 3 barman barman 4096 2020 20200218T210602
drwxr-xr-x 3 barman barman 4096 2020 20200218T210702
drwxr-xr-x 3 barman barman 4096 2020 20200218T210802
drwxr-xr-x 3 barman barman 4096 2020 20200218T210902
drwxr-xr-x 3 barman barman 4096 2020 20200218T211002
drwxr-xr-x 3 barman barman 4096 2020 20200218T211102
drwxr-xr-x 3 barman barman 4096 2020 20200218T211202
drwxr-xr-x 3 barman barman 4096 2020 20200218T211302
drwxr-xr-x 3 barman barman 4096 2020 20200218T211402
drwxr-xr-x 3 barman barman 4096 2020 20200218T211503
drwxr-xr-x 3 barman barman 4096 2020 20200218T211602
drwxr-xr-x 3 barman barman 4096 2020 20200218T211702
drwxr-xr-x 3 barman barman 4096 2020 20200218T211802
drwxr-xr-x 3 barman barman 4096 2020 20200218T211902
drwxr-xr-x 3 barman barman 4096 2020 20200218T212002
drwxr-xr-x 3 barman barman 4096 2020 20200218T212102
drwxr-xr-x 3 barman barman 4096 2020 20200218T212203
drwxr-xr-x 3 barman barman 4096 2020 20200218T212302
drwxr-xr-x 3 barman barman 4096 2020 20200218T212402
drwxr-xr-x 3 barman barman 4096 2020 20200218T212502
drwxr-xr-x 3 barman barman 4096 2020 20200218T212602
drwxr-xr-x 3 barman barman 4096 2020 20200218T212702
drwxr-xr-x 3 barman barman 4096 2020 20200218T212802
drwxr-xr-x 3 barman barman 4096 2020 20200218T212902
drwxr-xr-x 3 barman barman 4096 2020 20200218T213002
drwxr-xr-x 3 barman barman 4096 2020 20200218T213102
drwxr-xr-x 3 barman barman 4096 2020 20200218T213202


In  crontab we defined to create backup each day as

30 23 * * * /usr/bin/barman backup main-db-server
* * * * * /usr/bin/barman cron


But since we limit the    retention_policy = RECOVERY WINDOW OF 7 days

From my understanding this means - limit the backup only to 7 days , 

But in spite this we get much more backups , why?

Note - the reason that we want to limit the number of backup is because we have small disk 

meanwhile we delete the old backup manual 

as

 barman delete  main-db-server 20191019T233002
Your listing of /barman/main-db-server/base suggests you are taking a backup once a minute (Why and how?  I don't know.  Your given crontab doesn't seem to launch a backup that often--but something seems to be).  None of those backups are more than 7 days old, so there is no reason for them to be deleted based on the retention_policy = RECOVERY WINDOW OF 7 days

But you should really list your backups using barman list-backup, not by manually monkeying around inside barman's workspace.