- Added option CLEAN_DIR to backup_fsdiff.conf which enables/disables
purging of the backup directory whenever a new full backup is made.
Previously, the hard-coded behavior was to purge the $STORAGE directory.
- MD5 checksum is now only counted for the recently made backup file.
Previously, all checksums were recalculated.
Now it is possible to have the main backup repository mounted at $STORAGE
and keep several weeks (or whatever backup cycle you have) of backups there.
With previous versions of the script, you were supposed to transfer those
files to a remote server, while the local $STORAGE directory was only used as
temporary storage. Now you can even mount $STORAGE directly from the remote
server through NFS or iSCSI, if that is more convenient for you.
modified: backup_diff.sh
modified: backup_fsdiff.conf
modified: backup_full.sh
FILENAME=${DIFFNAME}${APPEND}
cd ${STORAGE}
dar --verbose --alter=atime --empty-dir --fs-root / --noconf --create ${STORAGE}${FILENAME} --ref $(ls --sort=t ${STORAGE}*.dar | head -n 1 | cut -d. -f1) -y9 -an --exclude-from-file ${EXCLUDE}
-md5sum -b *.dar > $(ls --sort=t ${FULLNAME}*.md5 | head -n 1)
+md5sum -b ${FILENAME}*.dar >> $(ls --sort=t ${FULLNAME}*.md5 | head -n 1)
case "${XFER_METHOD}" in
scp)
APPEND=$(date +%Y%m%d)
STORAGE=/var/backups/fs/data/
EXCLUDE=/var/backups/fs/exclude.lst
+CLEAN_DIR=false
XFER_METHOD=scp
XFER_USER=backup
. $1
FILENAME=${FULLNAME}${APPEND}
cd ${STORAGE}
-rm *
+if [ "${CLEAN_DIR}" = "true" ]; then rm *; fi
dar --verbose --alter=atime --empty-dir --fs-root / --noconf --create ${STORAGE}${FILENAME} -y9 -an --exclude-from-file ${EXCLUDE}
md5sum -b ${FILENAME}* > ${FILENAME}.md5
chown ${XFER_USER} ${FILENAME}.md5