[ALUG] Setting Crons on FreeBSD

Hamisi Jabe administrator at banana.co.tz
Sat Oct 3 16:56:26 EAT 2015


At last i managed to run the srcipt successfully on the cron



I added the two *bolded* lines on cron before the script

*SHELL=/bin/sh**
**PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin*

*/10 * * * * sh /etc/rsync.sh


And changed the access level of the rsync.sh


Without the above two lines its not executing








On 05/08/2015 02:07 alasiri, Andreas Tauscher via Linux wrote:
> Have you checked the mails for root?
> Output of the script you will not find in the logfile it is sent by mail.
> If there are no mails then set MAILTO=root in the crontab.
>
> Next if a script is running from a interactive shell does not mean it
> will run as cron job. The environment might be different.
> When you test the script set the environment identical to cron's
> So run as root (or what ever user you set in crontab)
> env -i SHELL=<from /etc/contab> PATH=<from /etc/contab> HOME=<user home>
> LOGIN=<login name> /etc/rsync.sh
>
>
>
>
> _______________________________________________
> The Arusha Linux User Group:http://unix.or.tz
> Linux mailing list
> Linux at lists.habari.co.tz
> http://lists.habari.co.tz/cgi-bin/mailman/listinfo/linux
>
> The Arusha LUG mailing list is generously hosted by Habari Node Ltd:http://www.habari.co.tz/
>
> The above comments and data are owned by whoever posted them (including attachments if any). The mailing list host is not responsible for them in any way.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.habari.co.tz/pipermail/linux/attachments/20151003/fa744dc6/attachment.html>
-------------- next part --------------
_______________________________________________
The Arusha Linux User Group: http://unix.or.tz
Linux mailing list
Linux at lists.habari.co.tz
http://lists.habari.co.tz/cgi-bin/mailman/listinfo/linux

The Arusha LUG mailing list is generously hosted by Habari Node Ltd: http://www.habari.co.tz/

The above comments and data are owned by whoever posted them (including attachments if any). The mailing list host is not responsible for them in any way.


More information about the Linux mailing list