summaryrefslogtreecommitdiff
blob: 3d53c7e9b0a219321b54ba8859153700a26872ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash

LOGFILE=/root/.log/cronlog
ERRFILE=/root/.log/errlog
BASEDIR=/root/opt/backup/etc/

rm $LOGFILE
rm $ERRFILE

date >> $LOGFILE
date >> $ERRFILE

find /etc/ | grep "~$" >> $LOGFILE
find /etc/ | grep "~$" | xargs rm 

rsync -rptgo --delete-after  --exclude ".svn/" /etc/ $BASEDIR 2>> $ERRFILE | grep -v "skipping"
cd $BASEDIR && TL=`find .` && for fl in $TL;do [ -L $fl ] && rm $fl;done
cd $BASEDIR && svn-del do &> $LOGFILE
cd $BASEDIR && svn-add do &> $LOGFILE

MESSAGE="$1"
[ ! "$MESSAGE" ] && MESSAGE="Automatic Update"
cd $BASEDIR >> $LOGFILE 2>> $ERRFILE && svn commit -m "$MESSAGE"  >> $LOGFILE 2>> $ERRFILE 

cat $LOGFILE
cat $ERRFILE