2022-02-23 06:44:21 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-02-23 06:52:04 +01:00
|
|
|
sql_dump_dir="/srv/store/common/sql"
|
2022-02-23 07:00:06 +01:00
|
|
|
postgres_dump_file="/srv/store/common/sql/postgres_$host.sql"
|
2022-02-23 06:52:04 +01:00
|
|
|
postgres_password="5H4bsfAVXGFQFYfpPzDtcYpUXB8vjQUT"
|
2022-02-23 06:44:21 +01:00
|
|
|
|
|
|
|
mkdir -p $sql_dump_dir
|
|
|
|
|
|
|
|
say "Photoprism: Importing media..."
|
2022-02-23 06:53:34 +01:00
|
|
|
podman exec -it photoprism photoprism import
|
2022-02-23 06:44:21 +01:00
|
|
|
|
|
|
|
say "Postgres: Dumping database to '$postgres_dump_file'..."
|
|
|
|
podman exec -i -e PGPASSWORD=$postgres_password postgres /usr/local/bin/pg_dumpall -U postgres > $postgres_dump_file
|
2022-02-23 07:00:06 +01:00
|
|
|
|
|
|
|
chmod -R 660 $sql_dump_dir
|
|
|
|
chown -R root:root $sql_dump_dir
|