backup_diff.sh: Replaced "ls --sort=t" with "ls -t" for FreeBSD compatibility
authorMegaBrutal <code+git@megabrutal.com>
Fri, 19 Feb 2016 04:40:30 +0000 (05:40 +0100)
committerMegaBrutal <code+git@megabrutal.com>
Fri, 19 Feb 2016 04:40:30 +0000 (05:40 +0100)
Turns out, "ls --sort=t" is not a valid syntax for FreeBSD, but "ls -t" has
the same function, and is accepted by both GNU and FreeBSD.

modified:   fs/backup_diff.sh

fs/backup_diff.sh

index c2b788eea10636abc3533bed30d6585757176fd4..3c557e7c64dcffb968ee1fce2a2b4156dc753e16 100755 (executable)
@@ -2,7 +2,7 @@
 . $1
 FILENAME=${DIFFNAME}${APPEND}
 cd ${STORAGE}
 . $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) -zbzip2:9 -an --exclude-from-file ${EXCLUDE}
+dar --verbose --alter=atime --empty-dir --fs-root / --noconf --create ${STORAGE}${FILENAME} --ref $(ls -1t ${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);;
 
 case $(uname) in
        Linux)  md5sum -b ${FILENAME}*.dar >> $(ls --sort=t ${FULLNAME}*.md5 | head -n 1);;