# Migrate backup to date-based format
if [ -f /srv/backup/postgres.dump ]; then
+ echo 'A backup without date was found. Moving it to postgres_old.dump'
mv /srv/backup/postgres.dump /srv/backup/postgres_old.dump
- ln -s /srv/backup/postgres_old.dump /srv/backup/postgres_latest.dump
+ if [ ! -f /srv/backup/postgres_latest.dump ]; then
+ ln -s /srv/backup/postgres_old.dump /srv/backup/postgres_latest.dump
+ fi
fi
# import database functions of type
# Migrate backup to date-based format
if [ -f /srv/backup/postgres.dump ]; then
+ echo 'A backup without date was found. Moving it to postgres_old.dump'
mv /srv/backup/postgres.dump /srv/backup/postgres_old.dump
- ln -s /srv/backup/postgres_old.dump /srv/backup/postgres_latest.dump
+ if [ ! -f /srv/backup/postgres_latest.dump ]; then
+ ln -s /srv/backup/postgres_old.dump /srv/backup/postgres_latest.dump
+ fi
fi
if [ ! -z "$MYSQL_PASSWORD" ]; then