Skip to content

Instantly share code, notes, and snippets.

@narankhetani
narankhetani / postgres.docker.backup.txt
Last active March 16, 2021 02:05
How to backup a AWX postgres database in docker.
To backup:
docker exec -u <your_postgres_user> <postgres_container_name> pg_dump -Fc <database_name_here> > db.dump
To drop db (Don't do it on production, for test purpose only!!!):
docker exec -u <your_postgres_user> <postgres_container_name> psql -c 'DROP DATABASE <your_db_name>'
To restore:
docker exec -i -u <your_postgres_user> <postgres_container_name> pg_restore -C -d postgres < db.dump
working example for awx postgres database
@narankhetani
narankhetani / docker.tip.txt
Created January 3, 2018 09:54
Docker Quick Commands
# list containers
docker ps
# logon to container
docker exec -it awx_task /bin/bash
@narankhetani
narankhetani / blob.json
Created November 21, 2017 21:36
juniper rpc output
{
"msg": {
"rpc_reply": {
"interface-information": [
{
"physical-interface": [
{
"active-alarms": [
{
"interface-alarms": [