/src/scripts/zotonic-snapshot

http://github.com/zotonic/zotonic · #! · 39 lines · 34 code · 5 blank · 0 comment · 0 complexity · 41b91e53d70ef5eacd49cabc97a4b92c 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. . $ZOTONIC_SCRIPTS/helpers/zotonic_setup
  20. SITE=$1
  21. if [ ! $SITE ]
  22. then
  23. echo USAGE: $0 [site_name] 1>&2
  24. echo USAGE: See ZotonicCommands.txt 1>&2
  25. else
  26. mkdir -p $SITES/$SITE/files/snapshot
  27. pg_dump zotonic_$SITE \
  28. > $SITES/$SITE/files/snapshot/zotonic_$SITE.sql
  29. pushd $SITES/$SITE > /dev/null
  30. hg init
  31. hg add
  32. hg commit -m "Content Snapshot"
  33. popd > /dev/null
  34. fi