Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rsync script error Script running -skipping . snapshots



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






BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org