I used the script provided, it seems to be working, but for some reason the following code is throwing me a syntax error: bad loop for variable:
Delete the oldest allowed historical backup and rename the others to make room for a new one.
rm -f $SHORT.$NUMBACKUPS.tar.gz
for ((I=NUMBACKUPS; I > 1; I=I-1)); do( syntax error from this line)
J=$((I-1))
if [ -e “$SHORT.$J.tar.gz” ]; then
mv $SHORT.$J.tar.gz $SHORT.$I.tar.gz
fi
done
I commented it out and the backup is successful without it, but I would like to be able rename the older backups.
I will try to continue to debug, but if anyone has run into this and has the solution, it would be greatly appreciated. Thanks!