Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- clear
- dbName="partner"
- # all tables
- tableNames=(alembic_version customers dynamic global_id logins products random_ascii resource_cache resources static_content variables)
- # only relevant tables
- tableNames=(customers dynamic products)
- currDate=$(date +"%Y-%d-%m")
- output_file="${dbName}_${currDate}.pg"
- touch ${output_file}
- echo "Writing dump to ${output_file} ..."
- for currTableName in "${tableNames[@]}"
- do
- echo "Adding the dump of table: ${currTableName} ..."
- pg_dump --data-only --table=${currTableName} $dbName >> $output_file ...
- done
- echo "Done"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement