pgBarman cron backup problem

44 views
Skip to first unread message

ra...@maxweb.pl

unread,
Feb 25, 2021, 1:02:46 AM2/25/21
to Barman, Backup and Recovery Manager for PostgreSQL
Hi,
I have a problem with cron backups. When I do it manually it works like a charm but when I want to do this by cron I have a problem and it doesnt work.

I think everything You need to help me is in attached file with barman diagnose.
My config files:

[root@barman ~]# cat /etc/cron.d/barman 
# m h  dom mon dow   user     command
  * *    *   *   *   barman   [ -x /usr/bin/barman ] && /usr/bin/barman -q cron
 30 11   *   *   6   barman   /usr/bin/barman backup ezddb


[root@barman ~]# cat /etc/barman.d/ezddb.conf 
[ezddb]
description = "*"
conninfo = host=ezddb user=barman dbname=postgres
streaming_conninfo = host=ezddb user=streaming_barman
backup_method = postgres
streaming_archiver = on
slot_name = barman

retention_policy = RECOVERY WINDOW OF 2 WEEKS
minimum_redundancy = 2

path_prefix = "/usr/pgsql-12/bin"
barman-diagnose.txt

Luca Ferrari

unread,
Feb 26, 2021, 5:22:20 AM2/26/21
to Barman, Backup and Recovery Manager for PostgreSQL
On Thu, Feb 25, 2021 at 7:02 AM ra...@maxweb.pl <ra...@maxweb.pl> wrote:
>
> Hi,
> I have a problem with cron backups. When I do it manually it works like a charm but when I want to do this by cron I have a problem and it doesnt work.
>
> I think everything You need to help me is in attached file with barman diagnose.
> My config files:
>
> [root@barman ~]# cat /etc/cron.d/barman
> # m h dom mon dow user command
> * * * * * barman [ -x /usr/bin/barman ] && /usr/bin/barman -q cron
> 30 11 * * 6 barman /usr/bin/barman backup ezddb
>

What is the problem you have with the cron execution? Have you tried
to look at cron logs or redirect output to somefile?
If the command runs interactively it is probably a permission problem
or an environment issue.

Luca

ra...@maxweb.pl

unread,
Feb 26, 2021, 5:27:58 AM2/26/21
to Barman, Backup and Recovery Manager for PostgreSQL
When it runs from cron I have this in backup info file:

"error": "failure copying files (data transfer failure on directory '/var/lib/barman/ezddb/base/20210220T113006/data')",

The end :-)   

Luca Ferrari

unread,
Feb 26, 2021, 8:20:05 AM2/26/21
to Barman, Backup and Recovery Manager for PostgreSQL
On Fri, Feb 26, 2021 at 11:28 AM ra...@maxweb.pl <ra...@maxweb.pl> wrote:
>
> When it runs from cron I have this in backup info file:
>
> "error": "failure copying files (data transfer failure on directory '/var/lib/barman/ezddb/base/20210220T113006/data')",

Could it be there is something dropping the connection at that
particular time (e.g., firewall)?
Do you experience the problem at "every" cron time? For example,
scheduling it near the time you execute it with success manually, does
improve?

Luca
Reply all
Reply to author
Forward
0 new messages