cron job website communication, find to find port?

19 views
Skip to first unread message

Hasanat Kazmi

unread,
Aug 4, 2009, 1:17:20 PM8/4/09
to web2py-users
I have a website where my cron job (present in application/cron) calls
webservices hosted by localhost. I have the whole URL but except the
port at which the website is hosted. I don't want to hardcode port 80,
any idea how to do it?


Hasanat Kazmi

AchipA

unread,
Aug 5, 2009, 6:19:18 AM8/5/09
to web2py-users
Not sure I follow... If you're using web2py cron I'd suggest calling
the function directly (see the cron doc page on syntax). If you're
using service mode on windows and this does not work out, you can
still call the function directly (e.g. python web2py.py -S application/
controller/function in the crontab)

Fran

unread,
Aug 5, 2009, 8:15:04 AM8/5/09
to web2py-users
On Aug 5, 11:19 am, AchipA <attila.cs...@gmail.com> wrote:
> If you're using service mode on windows and this does not work out, you can
> still call the function directly (e.g. python web2py.py -S application/
> controller/function in the crontab)

Great - this works for me with Windows Service & hence almost closes
my previous issue with this: http://groups.google.com/group/web2py/browse_thread/thread/b92a5485e6ae153b

The snaglet(s) left is that this isn't truly portable:
* Application name shouldn't hardcoded within the application
* This assumes running web2py from source...I guess web2py.exe would
work instead of 'python web2py.py' for the windows binary case

For portability we really need the usual syntax of *controller/
function

I'm happy to help test this, but I don't currently know enough about
either Cron or Windows service to start off cold.
- what would be really helpful is to have some logging somewhere & the
usual logging to console doesn't work in Windows service mode :/

F
Reply all
Reply to author
Forward
0 new messages