make_tar.sh 1.2 KB
Newer Older
Gerd Schachtschneider's avatar
Gerd Schachtschneider committed
1
2
3
4
5
#!/bin/bash

# create tar's from all projects
# schachi 2016-02-13

Gerd Schachtschneider's avatar
Gerd Schachtschneider committed
6
cd /var/www/html
Gerd Schachtschneider's avatar
Gerd Schachtschneider committed
7

Gerd Schachtschneider's avatar
Gerd Schachtschneider committed
8
9
10
if test $# -gt 0; then
 execute=$1
else
Gerd Schachtschneider's avatar
Gerd Schachtschneider committed
11
12
13
14
 echo -n "Common tar erzeugen (j/[n]) : "
 read ok
 if test -z $ok; then ok="n"; fi
 if test "$ok" = "j"; then  
Gerd Schachtschneider's avatar
Gerd Schachtschneider committed
15
  echo "create tar from xataface xataface-2.1.2/ master/ template/ favicon.ico index.html info.php"
16
  tar --exclude-vcs -czf db_export/mpidb_mpg_common.tar.gz xataface xataface-2.1.2/ xataface-2.1.3/ master/ template/ favicon.ico index.html info.php
Gerd Schachtschneider's avatar
Gerd Schachtschneider committed
17
18
 fi

Gerd Schachtschneider's avatar
Gerd Schachtschneider committed
19
20
21
22
23
24
 execute="mpg_*"
 echo -n "Wirklich von allen db's $execute ein tar generieren (j/[n]) : "
 read ok
 if test -z $ok; then ok="n"; fi
 if test "$ok" != "j"; then exit 0; fi 
fi
Gerd Schachtschneider's avatar
Gerd Schachtschneider committed
25

Gerd Schachtschneider's avatar
Gerd Schachtschneider committed
26
27
28
29
30
31
32
33
34
echo "Make tar for folder: $execute"

for project in $execute; do
  echo "Clear files in ${project}/templates_c und user_config"
  rm -R ${project}/templates_c/*
  rm ${project}/user_config/*
  echo "create tar from plain project ${project}"
  tar --exclude-vcs -czf db_export/mpidb_${project}.tar.gz ${project}/
  echo "create tar from project ${project} with common files"
35
  tar --exclude-vcs -czf db_export/mpidb_${project}_full.tar.gz xataface xataface-2.1.2/ xataface-2.1.3/ master/ template/ favicon.ico index.html info.php LICENSE.txt ${project}/
Gerd Schachtschneider's avatar
Gerd Schachtschneider committed
36
done