fi
# ok, we have a backup directory
if [ -r $RCFILE ]; then
- BCKUP_COMM=$(rsync -avz --progress ${RCFILE}* ${BASEDIR}/* ${BACKUPDIR})
+ BCKUP_COMM=$(rsync -avz --progress ${RCFILE}* ${BASEDIR}/ ${BACKUPDIR})
else
- BCKUP_COMM=$(rsync -avz --progress ${BASEDIR}/* ${BACKUPDIR})
+ BCKUP_COMM=$(rsync -avz --progress ${BASEDIR}/ ${BACKUPDIR})
fi
# run the command
if [ "$BCKUP_COMM" ]; then
fi
cp --verbose ${BACKUPDIR}/${BACKUPDB} $DB
fi
+ # restoring git repo subdirectory
+ if [ -d $BACKUPDIR/.git ]; then
+ if [ /bin/ls -A ${BASEDIR}/.git ]; then
+ rm -rf ${BASEDIR}/.git
+ fi
+ cp -r --verbose ${BACKUPDIR}/.git ${BASEDIR}/
+ fi
;;
* )
echo "No changes made. Exiting"
"version": "${VERSION}",
"dbversion": "${DBVERSION}"
},
+ "git": {
+ "lastpull": ""
+ },
"notes": []
}
__EOL__
fi
# ok, we have a backup directory
if [ -r $RCFILE ]; then
- BCKUP_COMM=$(rsync -avz --progress ${RCFILE}* ${BASEDIR}/* ${BACKUPDIR})
+ BCKUP_COMM=$(rsync -avz --progress ${RCFILE}* ${BASEDIR}/ ${BACKUPDIR})
else
- BCKUP_COMM=$(rsync -avz --progress ${BASEDIR}/* ${BACKUPDIR})
+ BCKUP_COMM=$(rsync -avz --progress ${BASEDIR}/ ${BACKUPDIR})
fi
# run the command
if [ "$BCKUP_COMM" ]; then
fi
cp --verbose ${BACKUPDIR}/${BACKUPDB} $DB
fi
+ # restoring git repo subdirectory
+ if [ -d $BACKUPDIR/.git ]; then
+ if [ /bin/ls -A ${BASEDIR}/.git ]; then
+ rm -rf ${BASEDIR}/.git
+ fi
+ cp -r --verbose ${BACKUPDIR}/.git ${BASEDIR}/
+ fi
;;
* )
echo "No changes made. Exiting"