- In dar invocations, changed the "-y9" switch to "-zbzip2:9", as recent
versions of dar don't recognize the former argument. Both arguments mean
the same, though: bzip2 compression on level 9 (best).
- FreeBSD doesn't have the md5sum utility to calculate checksums, thus
FreeBSD's md5 utility is used instead.
modified: fs/backup_diff.sh
modified: fs/backup_full.sh
. $1
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 ${FILENAME}*.dar >> $(ls --sort=t ${FULLNAME}*.md5 | head -n 1)
+dar --verbose --alter=atime --empty-dir --fs-root / --noconf --create ${STORAGE}${FILENAME} --ref $(ls --sort=t ${STORAGE}*.dar | head -n 1 | cut -d. -f1) -zbzip2:9 -an --exclude-from-file ${EXCLUDE}
+
+case $(uname) in
+ Linux) md5sum -b ${FILENAME}*.dar >> $(ls --sort=t ${FULLNAME}*.md5 | head -n 1);;
+ *BSD) md5 -r ${FILENAME}*.dar >> $(ls --sort=t ${FULLNAME}*.md5 | head -n 1);;
+esac
case "${XFER_METHOD}" in
scp)
FILENAME=${FULLNAME}${APPEND}
cd ${STORAGE}
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
+dar --verbose --alter=atime --empty-dir --fs-root / --noconf --create ${STORAGE}${FILENAME} -zbzip2:9 -an --exclude-from-file ${EXCLUDE}
+
+case $(uname) in
+ Linux) md5sum -b ${FILENAME}* > ${FILENAME}.md5;;
+ *BSD) md5 -r ${FILENAME}* > ${FILENAME}.md5;;
+esac
chown ${XFER_USER} ${FILENAME}.md5
case "${XFER_METHOD}" in