Add Cron job in Linux scheduler .
#Crontab -e
0 17 16 * * /usr/bin/sh /zimbra-incrimental-1st-run-16.sh >/dev/null 2>&1
#1 backup, run date 16
#date +'%d-%m-%y' -d '16 day ago' (after)
#date +'16-%m-%y' (before)
#2 backup, run date 1 in next month
#date +'15-%m-%y' -d 'last month' (after)
#date +'01-%m-%y' (before)
######################## DATE FORMAT MM/DD/YY ******************************
###########################################*********** RUN DATE 16 *********************###############
BACKUP_PATH=/opt-zimbra-backup/ms1
DATE=`date +'%d-%m-%y'`
SDATE=`date +'%m/%d/%y' -d '16 day ago'`
EDATE=`date +'%m/16/%y'`
mkdir -p $BACKUP_PATH/"$DATE"-incri
/opt/zimbra/bin/zmprov -l gaa -s `hostname` >/tmp/all.txt
while read line
do
echo -n "start backup $line .." >>/tmp/log-"$DATE".txt
#/opt/zimbra/bin/zmmailbox -z -m $line getRestURL "//?fmt=tgz&query=after:"10/21/21" and before:"11/22/21"" >/opt/zimbra/backup/"$DATE"-incri/"$line".tgz
/opt/zimbra/bin/zmmailbox -z -m $line getRestURL "//?fmt=tgz&query=after:"$SDATE" and before:"$EDATE"" >$BACKUP_PATH/"$DATE"-incri/"$line".tgz
if [ $? -eq 0 ]
then
echo "..done" >>/tmp/log-"$DATE".txt
else
echo echo "..failed" >>/tmp/log-"$DATE".txt
fi
done</tmp/all.txt