PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/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#
18# usage zotonic-snapshot [site_name]
19#
20
21SITE=$1
22
23if [ ! $SITE ]
24then
25	echo USAGE: $0 [site_name] 1>&2
26	echo USAGE: See ZotonicCommands.txt 1>&2
27else
28	mkdir -p $SITES/$SITE/files/snapshot
29	pg_dump zotonic_$SITE \
30			> $SITES/$SITE/files/snapshot/zotonic_$SITE.sql
31
32	pushd $SITES/$SITE > /dev/null
33	hg init
34	hg add
35	hg commit -m "Content Snapshot"
36	popd > /dev/null
37fi