I have a crontab job to sync a folder:50 5 * * * /home/user/bin/sync-folderThis will execute an script:#!/bin/bashsudo rsync -rav --delete --log-file=/tmp/rsync-output /origin /destinationgrep folder /tmp/rsync-outputif [ $? == 0 ]; then    cat /tmp/rsync-outputfiThe issue is that when there is nothing to sync, I get an email like this:sending incremental file listsent 343 bytes  received 17 bytes  720.00 bytes/sectotal size is 91,056  speedup is 252.93What I wanted is to receive an email only where there are new changes. How can I prevent this kind of emails?
Prevent empty rsync email on cron
cron;rsync
Replace this:50 5 * * * /home/user/bin/sync-folderWith this:50 5 * * * /home/user/bin/sync-folder > /dev/null 2>&1Add email inside script:#!/bin/bashsudo rsync -rav --delete --log-file=/tmp/rsync-output /origin /destinationgrep folder /tmp/rsync-outputif [ $? == 0 ]; then    mailx -s Rsync Complete at `date +%F %T` myemail@account.com < /tmp/rsync-outputfi