On Mon, 25 Feb 2013 21:45:52 +0100 Florian Philipp <li...@binarywings.net> wrote:
> Am 25.02.2013 21:39, schrieb Joseph: > > I'm updating clock via bash script. When I run it from a command > > line, it works just fine but when I try to run it via crontab I get: > > > > /home/thelma/business/programs/time_date_setting_script.sh: line 3: > > hwclock: command not found > > > > here the script: > > #!/bin/sh > > rdate -s 128.138.140.44 > > hwclock --systohc > > > > and crontab entry: > > 45 12 * * 1 > > sh /home/thelma/business/programs/time_date_setting_script.sh > > > > When I run the scrip manually or just the command: "hwclock > > --systohc" it is working OK; why isn't it working from the crontab? > > I've noticed that cron doesn't have /sbin and /usr/sbin in PATH. Try > using the absolute path to hwclock. With a recent upgrade of fcron, I ran into this problem (and solved it by switching to absolute paths). From fcron's changelog: * don't inherit fcron's environment when running a job but build the environment from scratch (cleaner, and this is what Vixie cron does) I have no idea how the environment is built from scratch, but for me anything run from the system crontab now has $PATH /usr/bin:/bin