> For instance, i have a script which i use to check if
> rsync is running, if it isn't running, then it will
> rsync, if it is, then it should skip rsync.  I put
> this in crontab for every 15 minutes.
> 
> On FreeBSD this works fine, on OpenSolaris it doesn't
> seem to be working.
> 
> any idea why this should be?

> #!/bin/sh
> PATH=/bin:/usr/bin:/usr/sbin
> SERVICE='rsync'
> REMOTE='[email protected]:/home/xxxxxx/xxxxx/'
> LOCAL='/tank/nas/dump/'
> LOG='/export/home/wonslung/log/rsync.log'
> if pgrep -u $USER $SERVICE
> then
>     echo "$SERVICE is running, skipping"
> 
> $SERVICE -ave ssh --delete $REMOTE $LOCAL >>$LOG
> fi


USER not defined in the cron environment?

The crontab(1) manual page documents these 
environment variables are available:

    HOME, SHELL, TZ

And when I check the environment variables in 
a cron job, I actually see PATH and LOGNAME to 
be defined, too:

    HOME=/files/jk
    LOGNAME=jk
    PATH=/usr/bin:
    SHELL=/usr/bin/sh
    TZ=Europe/Berlin
-- 
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to