Advertisement
Guest User

Untitled

a guest
May 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #!/bin/bash
  2. clear
  3.  
  4. dbName="partner"
  5.  
  6. # all tables
  7. tableNames=(alembic_version customers dynamic global_id logins products random_ascii resource_cache resources static_content variables)
  8.  
  9. # only relevant tables
  10. tableNames=(customers dynamic products)
  11.  
  12. currDate=$(date +"%Y-%d-%m")
  13. output_file="${dbName}_${currDate}.pg"
  14.  
  15. touch ${output_file}
  16. echo "Writing dump to ${output_file} ..."
  17.  
  18. for currTableName in "${tableNames[@]}"
  19. do
  20. echo "Adding the dump of table: ${currTableName} ..."
  21. pg_dump --data-only --table=${currTableName} $dbName >> $output_file ...
  22. done
  23.  
  24. echo "Done"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement