Cron Job with ASP.NET

sneckelmann

New Member
Messages
19
Reaction score
0
Points
0
Hello,

I'm new to cron jobs as a whole. I program in ASP.NET and cannot figure out how to get a job to run.

Do cron jobs work for ASP.NET?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Doesn't seem that there are that many ASPers here.

If those who do know it don't get you going, try:

1. Create an webpage/script that will do what you want when called from the web. Call it cron.aspx
2. Put it in a password protected directory like 'pwprotecteddir' so nobody will accidentally request it. Make up a username and password for it (do not use the ones you use to log in with etc)
3. Run a cron job with wget plus authentication:

Code:
wget   'http://username:password@yoursitename.com/pwprotecteddir/cron.aspx'

If the script runs properly when you request it over the web, this should work.

I just tested it out with a php script.
 

sneckelmann

New Member
Messages
19
Reaction score
0
Points
0
Thank you. I went with your suggestion. The script runs fine over the web, but the cron job reports:

/home/neckelma/www/cron/Default.aspx: line 1: %@: No such file or directory
/home/neckelma/www/cron/Default.aspx: line 2:
: command not found
/home/neckelma/www/cron/Default.aspx: line 3: !DOCTYPE: No such file or directory
/home/neckelma/www/cron/Default.aspx: line 4:
: command not found
/home/neckelma/www/cron/Default.aspx: line 5: html: No such file or directory
/home/neckelma/www/cron/Default.aspx: line 6: head: No such file or directory
/home/neckelma/www/cron/Default.aspx: line 7: syntax error near unexpected token `<'
/home/neckelma/www/cron/Default.aspx: line 7: ` <title></title>
'

That's it!
 
Last edited:

sneckelmann

New Member
Messages
19
Reaction score
0
Points
0
I got this figured out. For anyone questioning, you have to use "wget" (as suggested) followed by the full page address running the script.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
I got this figured out. For anyone questioning, you have to use "wget" (as suggested) followed by the full page address running the script.


Isn't that what I stated above?
 

sneckelmann

New Member
Messages
19
Reaction score
0
Points
0
Yes but I wasn't aware that you meant to use "wget" in the cron job. My mistake.

Any clue on how to get a script read permission for the mail directory?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Any clue on how to get a script read permission for the mail directory?

They should have it. At least PHP scripts have no problem.

The path to your mail dir should be somehthing like:

'/home/USERNAME/mail/DOMAINNAME.x10hosting.com/EMAILUSERNAME/cur/'
 
Last edited:

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
New email messages are stoked at '/home/USERNAME/mail/DOMAINNAME/EMAILUSERNAME/new/'
 

katwidme

New Member
Messages
1
Reaction score
0
Points
0
I make a cron.php and use wget method but is shows erorr

i want to call another domain which is hosted on window hosting for schedule job can any one give me solution..:confused:
 
Top