0

I have a php file in my server which used to send a mail. I want to trigger that file at particular time in day to send a mail. So i have planned to create a window service to trigger.But i don't know how to do it and how to mentioned the URL in a window service. So if you share any links or ideas it's more helpful to me.

Karthik
  • 67
  • 1
  • 9

2 Answers2

0

Create/Run cron jobs using ssh:

login in to server using ssh ..

type crontab -e
*/1 * * * * php SCRIPT_NAME --> this will run every minute
00 00 * * * php SCRIPT_NAME --> this will run at 12 AM every day
*/5 * * * * php SCRIPT_NAME -> every 5 minutes
if its giving you an option to select editor after crontab -e command, then select vim or vim basic
(To run python scripts replace php with python e.g. */1 * * * * python SCRIPT_NAME --> this will run every minute)
7,22,37,52 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1 ---> cron will run on 7th, 22nd, 37th and 52nd min of every hour
Waqas Shahid
  • 1,051
  • 1
  • 7
  • 22
0

If you want to call a website from C# all you should need is

WebRequest webRequest = WebRequest.Create("URL_HERE");
WebResponse webResp = webRequest.GetResponse();

replace the URL_HERE in above example with your URL.

mega6382
  • 9,211
  • 17
  • 48
  • 69