/src/scripts/zotonic-snapshot

https://code.google.com/p/zotonic/ · #! · 37 lines · 33 code · 4 blank · 0 comment · 0 complexity · 27380a325368f8c22c692060fe72ecc6 MD5 · raw file

  1. #!/usr/bin/env bash
  2. #
  3. # Copyright 2011 Lloyd R. Prentice
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. # usage zotonic-snapshot [site_name]
  18. #
  19. SITE=$1
  20. if [ ! $SITE ]
  21. then
  22. echo USAGE: $0 [site_name] 1>&2
  23. echo USAGE: See ZotonicCommands.txt 1>&2
  24. else
  25. mkdir -p $SITES/$SITE/files/snapshot
  26. pg_dump zotonic_$SITE \
  27. > $SITES/$SITE/files/snapshot/zotonic_$SITE.sql
  28. pushd $SITES/$SITE > /dev/null
  29. hg init
  30. hg add
  31. hg commit -m "Content Snapshot"
  32. popd > /dev/null
  33. fi