Olivier Bonvalet schrieb:
Hello,
I'm trying to change the weight of some real servers in cron, because
they have some "heavy" tasks.
So, some minutes before this tasks, I set to put the weight to 0, with
lines like this one :
45-59 23 * * 1 root /sbin/ipvsadm -e -t VIP:80 -r real1.hostname.tld
-i -w 0
This command works perfectly in command line, but when started from
cron, it have no effect.
In logs, I see only this :
Apr 24 23:45:01 LB1 /USR/SBIN/CRON[22494]: (root) CMD (/sbin/ipvsadm
-e -t VIP:80 -r real1.hostname.tld -i -w 0)
Did you try to use the IP instead of the DNS name? Just an idea ...
Otherwise, dump your shell's env, put it in a script, execute the
ipvsadm command at the end of the script and put that script in cron.
Might work, did not test it.
|