(in my script file - script.sh)
#!/bin/bash ssh 192.168.0.1 'iptables -L' > /tmp;
30 21 30 9 * root /bin/bash /script.sh
If I run the script in terminal, things work just fine. But use crontab to run it, the tmp will be generated, but there's nothing in the tmp file (0k). I already run ssh agent so ssh won't prompt to ask password. What could be the problem with this? Thanks.