buckup

#!/bin/bash

/Applications/pgAdmin 4.app/Contents/SharedSupport/pg_dump

–file “/Users/wqiong/buttons.sql”

–host “127.0.0.1”

–port “52260”

–username “postgres”

–no-password –verbose –format=c

–blobs “auth_dev_old”

/Applications/pgAdmin\ 4.app/Contents/SharedSupport/pg_dump \

–file “/Users/wqiong/buttons.sql” \

–host “dev.guaishoubobo.com” \

–port “5432” \

–username “postgres” \

–no-password –verbose –format=c \

–blobs “race_dev” “auth_dev”

pg_dump –file “/data/www/buttons.sql” –host “dev.guaishoubobo.com” –port “5432” –username “postgres” –no-password –verbose –format=c –blobs “race_dev”;

/Applications/pgAdmin 4.app/Contents/SharedSupport/pg_dump

–file “/Users/wqiong/buttons.sql”

–host “dev.guaishoubobo.com”

–port “5432”

–username “postgres”

–no-password –verbose –format=c

–blobs –table “public.uniques” “auth_dev”

dir=”/data/www/DatabasesBackup/“

echo “cd ${dir}”

cd $dir

echo ‘DATE=date +%Y%m%d-%H%M

BACK_DATA=xxapp-data-${DATE}.out # 这里设置备份文件的名字, 加入日期是为了防止重复

docker exec pg-db pg_dumpall -U postgres > ${BACK_DATA} # pg-db 是数据库的 docker 名称’

docker exec pg-db pg_dumpall -U postgres > ${BACK_DATA}

docker exec postgres pg_dump \

–file “buttons.sql” \

–host “dev.guaishoubobo.com” \

–port “5432” \

–username “postgres” \

–no-password –verbose –format=c \

–blobs “race_dev” -U “postgres” -W

O8MxsIhH

docker exec postgres pg_dump -U “postgres” –blobs “race_dev” –no-password –verbose –format=c –file “buttons.sql”

/Applications/pgAdmin\ 4.app/Contents/SharedSupport/pg_dump –file /root/gresql.sql\

–username “postgres” \

–no-password –verbose –format=c \

–blobs “race3”

-U “postgres” -W

//压缩模式二进制模式

docker exec postgres pg_dump –username “postgres” –no-password –verbose –format=c –blobs “race_dev” -f /data/backup.sql

docker exec postgres pg_restore –username “postgres” –no-password -c –verbose -d “test” /data/backup.sql

# //非压缩模式 ,pgsql模式

docker exec postgres pg_dump –username “postgres” –no-password –verbose –blobs “race_dev” -f /data/backup.sql

docker exec postgres psql –username “postgres” -d test3 -f /data/backup.sql

docker exec postgres pg_dump -h db -f /shared/backup.sql

for(var i in maps){

console.log(222)

addMarker(maps[i]);

}

dir=”var/lib/postgresql/buckup”

echo “cd ${dir}”

cd $dir

进入docker bash

echo “docker exec -it postgres bash”

docker exec -it postgres bash

将用户置为 postgres

echo “su postgres”

su postgres

进入sql命令行

echo “psql”

psql

展示所有数据库列表

\list

文章目录
  1. 1. /Applications/pgAdmin 4.app/Contents/SharedSupport/pg_dump
  2. 2. –file “/Users/wqiong/buttons.sql”
  3. 3. –host “127.0.0.1”
  4. 4. –port “52260”
  5. 5. –username “postgres”
  6. 6. –no-password –verbose –format=c
  7. 7. –blobs “auth_dev_old”
  8. 8. /Applications/pgAdmin\ 4.app/Contents/SharedSupport/pg_dump \
  9. 9. –file “/Users/wqiong/buttons.sql” \
  10. 10. –host “dev.guaishoubobo.com” \
  11. 11. –port “5432” \
  12. 12. –username “postgres” \
  13. 13. –no-password –verbose –format=c \
  14. 14. –blobs “race_dev” “auth_dev”
  15. 15. pg_dump –file “/data/www/buttons.sql” –host “dev.guaishoubobo.com” –port “5432” –username “postgres” –no-password –verbose –format=c –blobs “race_dev”;
  16. 16. /Applications/pgAdmin 4.app/Contents/SharedSupport/pg_dump
  17. 17. –file “/Users/wqiong/buttons.sql”
  18. 18. –host “dev.guaishoubobo.com”
  19. 19. –port “5432”
  20. 20. –username “postgres”
  21. 21. –no-password –verbose –format=c
  22. 22. –blobs –table “public.uniques” “auth_dev”
  23. 23. dir=”/data/www/DatabasesBackup/“
  24. 24. echo “cd ${dir}”
  25. 25. cd $dir
  26. 26. echo ‘DATE=date +%Y%m%d-%H%M
  27. 27. BACK_DATA=xxapp-data-${DATE}.out # 这里设置备份文件的名字, 加入日期是为了防止重复
  28. 28. docker exec pg-db pg_dumpall -U postgres > ${BACK_DATA} # pg-db 是数据库的 docker 名称’
  29. 29. docker exec pg-db pg_dumpall -U postgres > ${BACK_DATA}
  30. 30. docker exec postgres pg_dump \
  31. 31. –file “buttons.sql” \
  32. 32. –host “dev.guaishoubobo.com” \
  33. 33. –port “5432” \
  34. 34. –username “postgres” \
  35. 35. –no-password –verbose –format=c \
  36. 36. –blobs “race_dev” -U “postgres” -W
  37. 37. O8MxsIhH
  38. 38. docker exec postgres pg_dump -U “postgres” –blobs “race_dev” –no-password –verbose –format=c –file “buttons.sql”
  39. 39. /Applications/pgAdmin\ 4.app/Contents/SharedSupport/pg_dump –file /root/gresql.sql\
  40. 40. –username “postgres” \
  41. 41. –no-password –verbose –format=c \
  42. 42. –blobs “race3”
  43. 43. -U “postgres” -W
  44. 44. //压缩模式二进制模式
  45. 45. docker exec postgres pg_dump –username “postgres” –no-password –verbose –format=c –blobs “race_dev” -f /data/backup.sql
  46. 46. docker exec postgres pg_restore –username “postgres” –no-password -c –verbose -d “test” /data/backup.sql
  47. 47. # //非压缩模式 ,pgsql模式
  48. 48. docker exec postgres pg_dump –username “postgres” –no-password –verbose –blobs “race_dev” -f /data/backup.sql
  49. 49. docker exec postgres psql –username “postgres” -d test3 -f /data/backup.sql
  50. 50. docker exec postgres pg_dump -h db -f /shared/backup.sql
  51. 51. for(var i in maps){
  52. 52. console.log(222)
  53. 53. addMarker(maps[i]);
  54. 54. }
  55. 55. dir=”var/lib/postgresql/buckup”
  56. 56. echo “cd ${dir}”
  57. 57. cd $dir
  58. 58. 进入docker bash
  59. 59. echo “docker exec -it postgres bash”
  60. 60. docker exec -it postgres bash
  61. 61. 将用户置为 postgres
  62. 62. echo “su postgres”
  63. 63. su postgres
  64. 64. 进入sql命令行
  65. 65. echo “psql”
  66. 66. psql
  67. 67. 展示所有数据库列表
  68. 68. \list