diff --git a/Makefile b/Makefile index afe1221d..5179a2cb 100644 --- a/Makefile +++ b/Makefile @@ -93,3 +93,16 @@ deploy_prod: touch mamweb/wsgi.py @echo Done. +# Sync media directory with atrey. Useful for local development with production database +# Does not sync Galerie and CACHE (too huge). +sync_media: + rsync -ave ssh --exclude Galerie --exclude CACHE\ + atrey.karlin.mff.cuni.cz:/akce/MaM/WWW/mamweb-prod/media/ ./media/ +# Downloads and restores production database to local database. PostgreSQL only. +sync_db: + scp atrey.karlin.mff.cuni.cz:`ssh atrey.karlin.mff.cuni.cz 'ls -v /akce/MaM/WWW/backups/mam-prod-*\.pgdump | tail -n 1'` \ + ./last.pgdump + pg_restore -c -d mam -U mam last.pgdump + +# Sync database and media. See above lines +sync: sync_media sync_db