Thread: wget cron job
View Single Post
Old 11th September 2007, 15:21
Ben Ben is offline
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts

unfortunately I can't give you "code", just some hints

Things are quite easy, at first you could check why wget is not working inside the cron. Maybe you could source your users profile,
e.g. * * * * * * . /root/.bash_profile && wget ...
This should set environment vars etc. But this file(s) differ from distro to distro, and actually I have no clue what it is in MacOS. Then you could write stdout & stderr to a file in the cron, maybe wget is telling you what its problem is:
* * * * * wget ... 2>&1 >> /temp/wget.log

If you want to upload files from @home, you have to check with which method you want to upload the files, e.g. ftp(s) (ftps != sftp, sftp is based on sshd) (needs ftp server in the company site), scp (needs sshd on the company site). Based on this you have to define a firewall rule allowing these ports from outside, if you have a static IP only from that IP, if you have a dynamic one, from all IPs or a possible range. Then forward these packets to the local IP of the machine where the accepting daemon (ftp/ssh, etc) is running.
Reply With Quote