diff options
author | thekettu <samantha.chalker@nccgroup.trust> | 2018-04-08 18:28:57 -0700 |
---|---|---|
committer | thekettu <samantha.chalker@nccgroup.trust> | 2018-04-08 18:28:57 -0700 |
commit | f5e9ab45b12ba52316f739a79648ef6b1cfd121e (patch) | |
tree | fab4d300bb0041123a422daa9e69ce8d97de5a01 /in-a-box/mastodon.sh | |
parent | 187a54cec81e1e60f209fab8f19aeb5195521440 (diff) |
shellcheck
Diffstat (limited to 'in-a-box/mastodon.sh')
-rwxr-xr-x | in-a-box/mastodon.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/in-a-box/mastodon.sh b/in-a-box/mastodon.sh index 339913d..3975646 100755 --- a/in-a-box/mastodon.sh +++ b/in-a-box/mastodon.sh @@ -64,17 +64,17 @@ do_acme() { } do_backup() { - if ["$2" == "daily" ]; then + if [ "$2" == "daily" ]; then find "$(pwd)/.docker/mastodon/backups" -type f -name postgres-daily.* -mtime +7 -delete docker-compose exec -T -u postgres db sh -c "umask 0377 && /usr/local/bin/pg_dump -Fc -h db -d postgres -U postgres" > "$(pwd)/.docker/mastodon/backups/postgres-daily.$(date -Iseconds).pgsql" fi - if ["$2" == "hourly" ]; then + if [ "$2" == "hourly" ]; then find "$(pwd)/.docker/mastodon/backups" -type f -name postgres-hourly.* --min +360 -delete docker-compose exec -T -u postgres db sh -c "umask 0377 && /usr/local/bin/pg_dump -Fc -h db -d postgres -U postgres" > "$(pwd)/.docker/mastodon/backups/postgres-hourly.$(date -Iseconds).pgsql" fi - if ["$2" == "restore" ]; then + if [ "$2" == "restore" ]; then docker-compose run --rm db sh -c "/usr/local/bin/psql --set ON_ERROR_STOP=on -Fc -h db -d postgres -U postgres" < "$3" fi } @@ -100,9 +100,9 @@ case "$1" in do_cron ;; backup) - do_backup + do_backup "$@" ;; *) - do_rake + do_rake "$@" ;; esac |