Update mirrorsync.sh

Changed backticks to $()
This commit is contained in:
Dennis Körner 2021-06-03 11:14:26 +02:00 committed by GitHub
parent 2c764f7532
commit b8e86fbb1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,24 +52,24 @@ DST="/mnt/mirrorserver/${MIRRORMODULE}"
FILELISTFILE="fullfiletimelist-rocky" FILELISTFILE="fullfiletimelist-rocky"
LOCKFILE=$0.lockfile LOCKFILE=$0.lockfile
CHECKRESULT=`${RSYNC} --no-motd --dry-run --out-format='%n' ${SRC}${FILELISTFILE} ${DST}/${FILELISTFILE}` CHECKRESULT=$(${RSYNC} --no-motd --dry-run --out-format='%n' ${SRC}${FILELISTFILE} ${DST}/${FILELISTFILE})
if [ -z $CHECKRESULT ]; then if [ -z $CHECKRESULT ]; then
echo "${FILELISTFILE} unchanged. Not updating at " `date` >> $0.log 2>&1 echo "${FILELISTFILE} unchanged. Not updating at" $(date) >> $0.log 2>&1
logger -t rsync "Not updating ${MIRRORMODULE}: ${FILELISTFILE} unchanged." logger -t rsync "Not updating ${MIRRORMODULE}: ${FILELISTFILE} unchanged."
exit 1 exit 1
fi fi
if [ -e $LOCKFILE ]; then if [ -e $LOCKFILE ]; then
echo "Update already in progress at" `date` >> $0.log 2>&1 echo "Update already in progress at" $(date) >> $0.log 2>&1
logger -t rsync "Not updating ${MIRRORMODULE}: already in progress." logger -t rsync "Not updating ${MIRRORMODULE}: already in progress."
else else
touch $LOCKFILE touch $LOCKFILE
echo "Started update at" `date` >> $0.log 2>&1 echo "Started update at" $(date) >> $0.log 2>&1
logger -t rsync "Updating ${MIRRORMODULE}" logger -t rsync "Updating ${MIRRORMODULE}"
${RSYNC} ${OPTS} ${SRC} ${DST}/ >> $0.log 2>&1 ${RSYNC} ${OPTS} ${SRC} ${DST}/ >> $0.log 2>&1
logger -t rsync "Finished updating ${MIRRORMODULE}" logger -t rsync "Finished updating ${MIRRORMODULE}"
echo "End: "`date` >> $0.log 2>&1 echo "End:" $(date) >> $0.log 2>&1
rm $LOCKFILE rm $LOCKFILE
fi fi