List changes and backup directory option
This commit is contained in:
parent
73b7f646b4
commit
f79fa902fc
@ -5,14 +5,24 @@ exec > backup.log
|
|||||||
|
|
||||||
# exec 2> backup_err.log
|
# exec 2> backup_err.log
|
||||||
|
|
||||||
BAKDIR=/media/backup_mirror
|
BMOUNT=/mnt/backup
|
||||||
|
BAKDIR=$BMOUNT/backup/cron
|
||||||
|
|
||||||
if ! grep -qs $BAKDIR /proc/mounts; then
|
if ! grep -qs $BMOUNT /proc/mounts; then
|
||||||
echo Mounting $BAKDIR ...
|
echo Mounting $BMOUNT ...
|
||||||
mount $BAKDIR
|
mount $BMOUNT
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if ! [ -d $BAKDIR ]; then
|
||||||
|
mkdir $BAKDIR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo Begin backup schedule:
|
||||||
|
echo Date: $(date)
|
||||||
|
echo $'\n'
|
||||||
|
|
||||||
while read line; do
|
while read line; do
|
||||||
|
|
||||||
# substring first char
|
# substring first char
|
||||||
@ -49,7 +59,7 @@ while read line; do
|
|||||||
# count backup file
|
# count backup file
|
||||||
fCount=$(ls $BAKDIR/*$FILENAME*.gz|wc -l)
|
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
|
# keep up to 7 backup
|
||||||
if [ $fCount -ne 7 ]; then
|
if [ $fCount -ne 7 ]; then
|
||||||
@ -76,4 +86,4 @@ while read line; do
|
|||||||
# echo --\> $line
|
# echo --\> $line
|
||||||
done < backup_list
|
done < backup_list
|
||||||
|
|
||||||
umount $BAKDIR
|
umount $BMOUNT
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
# git backups
|
# git backups
|
||||||
/srv/repo/blogAPI.git
|
/home/git/repositories/blogAPI.git
|
||||||
/srv/repo/wenku8.git
|
/home/git/repositories/wenku8.git
|
||||||
/wenku8-android.git
|
/home/git/repositories/wenku8-android.git
|
||||||
|
/home/git/repositories/MetroSSH.git
|
||||||
|
/home/git/repositories/wconv.git
|
||||||
|
/home/git/repositories/utils.git
|
||||||
|
|
||||||
# www
|
# www
|
||||||
/var/www/wenku8
|
/var/www/wenku8
|
||||||
|
Loading…
Reference in New Issue
Block a user