Update 'duplicacy.sh'

This commit is contained in:
2020-07-30 16:37:18 -04:00
parent ea4842d473
commit 6a6d011722

View File

@@ -12,6 +12,39 @@ fi
trap "rm -f ${lockfile}; exit" INT TERM EXIT
echo $$ > ${lockfile}
# Determine the Kernel and Architecture
KERNEL=$(uname)
ARCH=$(uname -m)
if [${KERNEL} == 'Linux']; then
if [ ${ARCH} == 'x86_64' ]; then
cp -v $(dirname "$0")/binaries/duplicacy_linux_x64_2.6.1 /usr/bin/duplicacy >> ${LOGFILE}
chown +x /usr/bin/duplicacy >> ${LOGFILE}
elif [ ${ARCH} == 'aarch64' ]; then
cp -v $(dirname "$0")/binaries/duplicacy_linux_arm64_2.6.1 /usr/bin/duplicacy >> ${LOGFILE}
chown +x /usr/bin/duplicacy >> ${LOGFILE}
else
echo "Kernel Type: ${KERNEL}"
echo "Arch: ${ARCH}"
echo "Arch not supported."
exit
fi
elif [${KERNEL} == 'FreeBSD']; then
if [ ${ARCH} == 'amd64' ]; then
cp -v $(dirname "$0")/binaries/duplicacy_freebsd_x64_2.6.1 /usr/bin/duplicacy >> ${LOGFILE}
chown +x /usr/bin/duplicacy >> ${LOGFILE}
else
echo "Kernel Type: ${KERNEL}"
echo "Arch: ${ARCH}"
echo "Arch not supported."
exit
fi
else
echo "Kernel Type: ${KERNEL}"
echo "Arch: ${ARCH}"
echo "Kernel not supported."
exit
fi
# run the backup
cd /
duplicacy -verbose -log backup -stats >> ${LOGFILE} 2>&1