DO_COMPRESS=$4
EXT=tar
- TAR_CMD_OPTS="--create --preserve --sparse"
+ TAR_CMD_OPTS="--create --atime-preserve --preserve-permissions --preserve-order --sparse"
SPLIT_CMD_OPTS="--bytes=${TAR_MAX_VOLUME_SIZE}"
if [ -n "${DO_COMPRESS}" ] ; then
EXT=tbz
--lock-tables \
--quote-names \
--add-drop-table \
+ --quick \
${V_PARAM} --all-databases | bzip2 -c >"${DUMPFILE_ABS}"
echo " [`date`]: fertig DUMP"
remove_all( ) {
echo
echo "Lösche alle lokalen Backups unter ${BACKUP_DIR} ..."
- find ${BACKUP_DIR} -type f -exec rm -v {} \;
+ #find ${BACKUP_DIR} -type f -exec rm -v {} \;
+ for f in ${BACKUP_DIR}/* ; do
+ if [ -f "${f}" ] ; then
+ rm -v "${f}"
+ fi
+ done
}
#######################################################################
fi
done
-do_backup_fs "/etc" "etc" "${DATUM}" 1
-do_backup_fs "/var/bind" "bind" "${DATUM}" 1
-do_backup_fs "/var/lib/portage" "lib-portage" "${DATUM}" 1
-do_backup_fs "/var/lib/ip*tables" "iptables" "${DATUM}" 1
-do_backup_fs "/var/lib/openldap-*" "openldap" "${DATUM}" 1
-do_backup_fs "/var/lib/svn-repos" "subversion" "${DATUM}" 1
-do_backup_fs "/var/log" "var-log" "${DATUM}" 1
-do_backup_fs "/root" "root" "${DATUM}" 1
+do_backup_fs "/etc" "etc" "${DATUM}" 1
+do_backup_fs "/var/bind" "var-bind" "${DATUM}" 1
+do_backup_fs "/var/lib/portage" "var-lib-portage" "${DATUM}" 1
+do_backup_fs "/var/lib/git" "var-lib-git" "${DATUM}" 1
+do_backup_fs "/var/lib/ip*tables" "var-lib-iptables" "${DATUM}" 1
+do_backup_fs "/var/lib/openldap-*" "var-lib-openldap" "${DATUM}" 1
+do_backup_fs "/var/lib/layman" "var-lib-layman" "${DATUM}" 1
+do_backup_fs "/var/lib/svn-repos" "var-lib-subversion" "${DATUM}" 1
+do_backup_fs "/var/lib/svn-repos-priv" "var-lib-svn-priv" "${DATUM}" 1
+do_backup_fs "/var/log" "var-log" "${DATUM}" 1
+do_backup_fs "/var/spool/cron/crontabs" "var-spool-crontabs" "${DATUM}" 1
+do_backup_fs "/root" "root" "${DATUM}" 1
+
+BOOT_MOUNTED=
+if [ -d /boot/grub ] ; then
+ BOOT_MOUNTED=1
+fi
+
+if [ -z "${BOOT_MOUNTED}" ] ; then
+ mount /boot
+ if [ "$?" != "0" ] ; then
+ echo "Konnte /boot nicht mounten." >&2
+ exit 8
+ fi
+fi
+
+do_backup_fs "/boot" "boot" "${DATUM}" 1
+
+if [ -z "${BOOT_MOUNTED}" ] ; then
+ umount /boot
+fi
for dir in /home/* ; do
echo "[`date`]: Vorbereitung Backup beendet."
echo
+exit 0
+
# vim: noai : ts=4 fenc=utf-8 filetype=sh : expandtab