Update shebang and date to POSIX format for working on FreeBSD (not
authorGérald Niel <gerald.niel@gegeweb.org>
Mon, 19 Mar 2018 21:06:21 +0000 (22:06 +0100)
committerGérald Niel <gerald.niel@gegeweb.org>
Mon, 19 Mar 2018 21:06:21 +0000 (22:06 +0100)
tested on Linux)

scripts/upgrade.sh

index 9baf50932c4d39393b2ab43514d24382b2ee424a..a0abe7ea61a7faaa2f899edb689c37c4d69d2db1 100755 (executable)
@@ -1,10 +1,10 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Strict mode
 set -e
 
 # Backup database
-SQL_BACKUP_PATH="/var/www/peertube/backup/sql-peertube_prod-$(date -Im).bak" 
+SQL_BACKUP_PATH="/var/www/peertube/backup/sql-peertube_prod-$(date +\"%Y%m%d-%h%m\").bak" 
 mkdir -p /var/www/peertube/backup
 pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH"