On Debian 8 after adding
@reboot-line to crontab there are some strange results. All actions are performed by root.
crontab -l shows
startup.sh (+x rights):
#!/bin/bash dhclient eth0 iptables-restore < /root/ipt echo test > /tmp/startup.log
After reboot I can see in /var/log/syslog something like
(root) CMD (/root/startup.sh) and there is word "test" in /tmp/startup.log. But dhclient and iptables did not work.
If I run the script manually all three lines give the result (i.e. ip address is received and iptables are restored).
How do I make it work through cron?