Jump to content

Block website


djerniehoule

Recommended Posts

Hello,

I run an online radio station. On Saturday from 5pm to 7pm we take requests via a form on our website. When a request is submitted it automatically goes into a cue. I am trying to either disable that script to a certain time, or put the script on a separate page, but only give access during specified time.. any ideas, suggestions?

Link to comment
Share on other sites

Hi,

If you want to run your script for particular time then you can use cron job for that.

What is cron job?

Cron jobs are the defined tasks that the systems run on decided time interval. In other words you can these are the predefined task that runs on the system in particular interval of time. You can set up your cron jobs through cpanel for the particular task like get the email notification, specify the command to run on particular time. 

You can add cron job with 2 ways in your website:

  • Command Line
  • Cpanel

You can follow this link to set cron job with command line for details: https://hoststud.com/resources/how-to-add-crontab-and-cron-job-in-linux.256/

You can follow below steps to set cronjob with cpanel:

1. First login to cpanel

2. In “advanced” section click on cron jobs icon.

3. Now set an email cron job through cpanle.

  • To set an email cron you have to enter email address into email text box.
  • Click on “update email

4. Now set the cron jobs time interval through add new cron job.

  • Common settings : click on drop down option and you will find the predefined settings for cron jobs. You can use the predefined common settings, either you can create your own.
  • Minute : select a particular time in minutes to hour in which you want to run your cron job.
  • Hour : select a particular time in hour in which you want to run your cron job.
  • Day : select a particular day in which you want to run your cron job.
  • Month : in this menu select the number of months on which you want to run your cron job.
  • Weekday : select the days of week on which you want to run the cron job.

5. Now its time to enter the desired command in text box :

PHP:
php -q /home/user/public_html /testrun.php

Note : Here user is your username in cPanel.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...