rsync script error Script running -skipping . snapshots

Richard Chonak rac-7q86n6wRh+gPnHn3N7+5xA at public.gmane.org
Sat Dec 12 21:22:06 EST 2009


On 12/12/2009 06:50 PM, sgoldman wrote:

> I will verify after I see the mail message in my inbox.

>
> [root@ ~]# vi bakdir
> #!/bin/bash
> /usr/bin/rsync -avz --delete --exclude ".snapshot" /mnt/external/.
> /data/biomicro/external >> /var/log/rsync/backup.log && mail -s "cron
> job external ran" sgoldman-3s7WtUTddSA at public.gmane.org


You may need to specify the input stream of "mail" explicitly: e.g., 
'mail -s "cron job external ran" sgoldman-3s7WtUTddSA at public.gmane.org </dev/null' .

Also, "&&" has the effect "if successful, then"; so the 'mail' command 
would only run if rsync returns a successful status.  If you change that 
to "||", it'll execute mail regardless.

--RC





More information about the Discuss mailing list