commit f79fa902fca859edb7a4afcc5ee824954bce8f34
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2014-01-24T07:59:21Z |
| subject | List changes and backup directory option |
commit f79fa902fca859edb7a4afcc5ee824954bce8f34
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2014-01-24T07:59:21Z
List changes and backup directory option
---
bash/cronbackup/backup.sh | 22 ++++++++++++++++------
bash/cronbackup/backup_list | 9 ++++++---
2 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/bash/cronbackup/backup.sh b/bash/cronbackup/backup.sh
index 5d7d861..f816d15 100644
--- a/bash/cronbackup/backup.sh
+++ b/bash/cronbackup/backup.sh
@@ -5,13 +5,23 @@ exec > backup.log
# exec 2> backup_err.log
-BAKDIR=/media/backup_mirror
+BMOUNT=/mnt/backup
+BAKDIR=$BMOUNT/backup/cron
-if ! grep -qs $BAKDIR /proc/mounts; then
- echo Mounting $BAKDIR ...
- mount $BAKDIR
+if ! grep -qs $BMOUNT /proc/mounts; then
+ echo Mounting $BMOUNT ...
+ mount $BMOUNT
fi
+
+if ! [ -d $BAKDIR ]; then
+ mkdir $BAKDIR
+fi
+
+
+echo Begin backup schedule:
+echo Date: $(date)
+echo $'\n'
while read line; do
@@ -49,7 +59,7 @@ while read line; do
# count backup file
fCount=$(ls $BAKDIR/*$FILENAME*.gz|wc -l)
- echo Checking for expired backups $FILENAME \($fCount\)
+ echo Checking for expired backups $FILENAME \($fCount\)
# keep up to 7 backup
if [ $fCount -ne 7 ]; then
@@ -76,4 +86,4 @@ while read line; do
# echo --\> $line
done < backup_list
-umount $BAKDIR
+umount $BMOUNT
diff --git a/bash/cronbackup/backup_list b/bash/cronbackup/backup_list
index 02403a6..a3b769e 100644
--- a/bash/cronbackup/backup_list
+++ b/bash/cronbackup/backup_list
@@ -1,7 +1,10 @@
# git backups
-/srv/repo/blogAPI.git
-/srv/repo/wenku8.git
-/wenku8-android.git
+/home/git/repositories/blogAPI.git
+/home/git/repositories/wenku8.git
+/home/git/repositories/wenku8-android.git
+/home/git/repositories/MetroSSH.git
+/home/git/repositories/wconv.git
+/home/git/repositories/utils.git
# www
/var/www/wenku8