Send netdisco-users mailing list submissions to
        netdisco-users@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/netdisco-users
or, via email, send a message with subject or body 'help' to
        netdisco-users-requ...@lists.sourceforge.net

You can reach the person managing the list at
        netdisco-users-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of netdisco-users digest..."
Today's Topics:

   1. Docker Database Backup... (Chris)
   2. Re: Docker Database Backup... (Chris)
--- Begin Message ---

 

New user here, got everything setup and running well. I have bunch of devices in my installation, some are not CDP neighbor discoverable so I have added a bunch of devices manually.

 

My question is, how can I backup my Netdisco database, I use a docker install. In the documentation there is the following instructions, but how would I use this in the case of a docker inatall? Would I edit cron directly on the netdisco-netdisco-postgresql-1 container?

 

Source:  https://metacpan.org/release/OLIVER/App-Netdisco-2.036008/view/lib/App/Netdisco/Manual/Deployment.pod#Database-Backups

 

DATE=`date +%Y%m%d`

/usr/bin/pg_dump -F c --create -f /path/to/backups/netdisco-pgsql-$DATE.dump netdisco

gzip -9f /path/to/backups/netdisco-pgsql-$DATE.dump

/usr/bin/find /path/to/backups/ -type f -ctime +30 -exec rm {} \;

 

Thanks for your help!

Chris


--- End Message ---
--- Begin Message ---

I got this sorted out, I figure I would post this for other folks out there.

 

In the Netdisco compose file, under the netdisco-postgresql container section. I added a backup volume that mapped into my local storage.

 

  netdisco-postgresql:

    image: netdisco/netdisco:latest-postgresql

 

    volumes:

      - "/opt/netdisco/pgdata:/var/lib/postgresql/data"

      - "/data/backups/servers/netdisco-db:/db-backup"

 

 

I then took the script I mentioned before and modified it to include the “docker exec” commands:

 

#!/bin/bash

DATE=`date +%Y%m%d`

docker exec netdisco-netdisco-postgresql-1 pg_dump -U netdisco -F c --create -f /db-backup/netdisco-pgsql-$DATE.dump netdisco

gzip -9f /data/backups/servers/netdisco-db/netdisco-pgsql-$DATE.dump

/usr/bin/find /data/backups/servers/netdisco-db/ -type f -ctime +10 -exec rm {} \;

 

 

From: Chris
Sent: Wednesday, March 29, 2023 1:45 PM
To: netdisco-users@lists.sourceforge.net
Subject: Docker Database Backup...

 

 

New user here, got everything setup and running well. I have bunch of devices in my installation, some are not CDP neighbor discoverable so I have added a bunch of devices manually.

 

My question is, how can I backup my Netdisco database, I use a docker install. In the documentation there is the following instructions, but how would I use this in the case of a docker inatall? Would I edit cron directly on the netdisco-netdisco-postgresql-1 container?

 

Source:  https://metacpan.org/release/OLIVER/App-Netdisco-2.036008/view/lib/App/Netdisco/Manual/Deployment.pod#Database-Backups

 

DATE=`date +%Y%m%d`

/usr/bin/pg_dump -F c --create -f /path/to/backups/netdisco-pgsql-$DATE.dump netdisco

gzip -9f /path/to/backups/netdisco-pgsql-$DATE.dump

/usr/bin/find /path/to/backups/ -type f -ctime +30 -exec rm {} \;

 

Thanks for your help!

Chris

 


--- End Message ---
_______________________________________________
Netdisco mailing list - Digest Mode
netdisco-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/netdisco-users

Reply via email to