Unable to perform Backup using pg_dump

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 25.0.2
Operating system and version (eg, Ubuntu 20.04): Truenas SCALE

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N):N

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):
‘datadirectory’ => ‘/var/www/html/data’,
‘dbtype’ => ‘pgsql’,
‘version’ => ‘25.0.2.3’,
‘overwrite.cli.url’ => ‘http://192.168.1.8:10020/’,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘nextcloud-postgresql’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘nextcloud’,
‘dbpassword’ => ‘BbhyQZiieVmQ7eBT63SouPoQ6KhP5A9j0IUYO0YIFatc9u7tiX’,
‘installed’ => true,
‘instanceid’ => ‘oc75m0hom79y’,
‘preview_imaginary_url’ => ‘http://127.0.0.1:9090’,
‘preview_max_x’ => ‘2048’,
‘preview_max_y’ => ‘2048’,
‘preview_max_memory’ => ‘512’,
‘preview_max_filesize_image’ => ‘150’,
‘default_phone_region’ => ‘US’,
‘enabledPreviewProviders’ =>

hello im unable to perform a backup of nextcloud database i got the below error

$ psql -U nextcloud pg_dump nextcloud > /home/admin/nextcloud-$(date ‘+%Y%m%d’).sql

/bin/sh: 7: cannot create /home/admin/nextcloud-20230416.sql: Directory nonexistent

does this directory /home/admin exsist

as your error states it doesn’t.

if it does. does whoami output admin

If there is no user admin have you created the directory manualy and set the correct permissions.

Hello i would like to thank you for your reply yeah i confirm that /home/admin exist and i have full access

I think it can not creat file of backup *.sql