Sourced config.sh

This commit is contained in:
斟酌 鵬兄 2014-04-20 23:22:07 +08:00
parent de09f40deb
commit 1bbc562fce
3 changed files with 18 additions and 8 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.log

View File

@ -1,18 +1,17 @@
#!/bin/bash
source ./config.sh
# IO Redirection
exec > backup.log
exec > $LOGFILE
# exec 2> backup_err.log
exec 2> $ERRLOG
BMOUNT=/mnt/backup
BAKDIR=$BMOUNT/backup/cron
if ! grep -qs $BMOUNT /proc/mounts; then
if [[ -n $BMOUNT ]] && ! grep -qs $BMOUNT /proc/mounts; then
echo Mounting $BMOUNT ...
mount $BMOUNT
MOUNTED=$?
fi
if ! [ -d $BAKDIR ]; then
mkdir $BAKDIR
@ -86,4 +85,6 @@ while read line; do
# echo --\> $line
done < backup_list
umount $BMOUNT
if [[ "$MOUNTED" -eq 0 ]]; then
umount $BMOUNT
fi

View File

@ -0,0 +1,7 @@
#!/bin/bash`
LOGFILE=backup.log
ERRLOG=backup_errors.log
BMOUNT=/mnt/backup
BAKDIR=$BMOUNT/backup/cron