|
Revision 1405, 0.7 kB
(checked in by jm3, 2 years ago)
|
updated configuration setup script to also build our crontab file, so now there are like, ZERO passwords or paths coded anywhere
|
- Property svn:eol-style set to
native
- Property svn:executable set to
*
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
#!/bin/bash |
|---|
| 2 |
|
|---|
| 3 |
type=$1 |
|---|
| 4 |
. env.sh |
|---|
| 5 |
|
|---|
| 6 |
# all read in from from env.sh |
|---|
| 7 |
root=`get_webserver_root` |
|---|
| 8 |
|
|---|
| 9 |
if [ -z "$type" ]; |
|---|
| 10 |
then |
|---|
| 11 |
echo "usage: $0 (daily|weekly|monthly)" |
|---|
| 12 |
exit 1 |
|---|
| 13 |
fi |
|---|
| 14 |
|
|---|
| 15 |
dir=$root/_backups/$type |
|---|
| 16 |
echo $dir |
|---|
| 17 |
|
|---|
| 18 |
if [ "$type" = "daily" ] ; |
|---|
| 19 |
then |
|---|
| 20 |
dayOfWeek=`date +%w` |
|---|
| 21 |
if [ "$dayOfWeek" = 1 ] ; |
|---|
| 22 |
then |
|---|
| 23 |
echo clearing $dir: |
|---|
| 24 |
mkdir -p $dir |
|---|
| 25 |
mv -f $dir/* /tmp &> /dev/null |
|---|
| 26 |
fi |
|---|
| 27 |
elif [ "$type" = "weekly" ] ; |
|---|
| 28 |
then |
|---|
| 29 |
echo clearing $dir: |
|---|
| 30 |
mkdir -p $dir |
|---|
| 31 |
mv -f $dir/* /tmp &> /dev/null |
|---|
| 32 |
|
|---|
| 33 |
mkdir -p daily |
|---|
| 34 |
mv -f daily/* /tmp &> /dev/null |
|---|
| 35 |
|
|---|
| 36 |
elif [ "$type" = "monthly" ] ; |
|---|
| 37 |
then |
|---|
| 38 |
mkdir -p $dir |
|---|
| 39 |
#echo clearing $dir: |
|---|
| 40 |
#mv -f $dir/* /tmp &> /dev/null |
|---|
| 41 |
else |
|---|
| 42 |
echo "usage: $0 (daily|weekly|monthly)" |
|---|
| 43 |
exit 1 |
|---|
| 44 |
fi |
|---|
| 45 |
|
|---|
| 46 |
backup-dump-tables.sh $dir |
|---|
| 47 |
|
|---|