PDA

View Full Version : How to set cron every one minute


Easy5s.net
09-25-2013, 03:07 PM
Hello, i wan set cron every one minute in vbb Scheduled Task Manager?

Lynne
09-25-2013, 06:09 PM
From the admin popup help page:

Set it to * to have it run every minute (not really recommended!).

ozzy47
09-25-2013, 07:32 PM
What would be the purpose of running something every minute, what is it exactly you are trying to accomplish?

Easy5s.net
09-26-2013, 01:43 AM
From the admin popup help page:
Yes, i have set like, but it not run as cron time. It is usually delay 1 to 2 minutes, sometimes more than 10 minutes

nhawk
09-26-2013, 10:07 AM
Yes, i have set like, but it not run as cron time. It is usually delay 1 to 2 minutes, sometimes more than 10 minutes

That is because they aren't cron tasks in the sense that they run at a given time without any other trigger. vB's scheduled tasks only run when someone visits your site. And they run in a given order, so your task won't run until all tasks ahead of it have been completed. This can take hours on some sites. So, all tasks can be delayed.

CAG CheechDogg
09-28-2013, 01:53 AM
Yikes! running those scheduled tasks could lead to trouble with your host, if you are on a shared hosting plan you are only allowed 25 process if that, having something like this every minute will definitely make your host shut you down quick.

Easy5s.net
09-28-2013, 11:45 PM
I use dedicated servers and I needed such a cron

tbworld
09-29-2013, 12:16 AM
It might take me some time but there is several posts here -- I think -- on how to use your OS to run cron jobs. I run my vb cron jobs via the OS, but my setup won't help you unfortunately.

Maybe someone else knows where these posts are. I put you on my backlog and will do a bit of research for you later.

CAG CheechDogg
09-29-2013, 12:33 AM
I use dedicated servers and I needed such a cron

Well, what is the cron job supposed to do? Are you using cPanel?

Lynne
09-29-2013, 12:43 AM
Can you write an actual cron job to do what you want?

tbworld
09-29-2013, 12:44 AM
Well, what is the cron job supposed to do? Are you using cPanel?

Good point @CheechDogg, I have direct access to my servers so I tend to forget about cPanel.

CAG CheechDogg
09-29-2013, 12:47 AM
You can use the following to set up a cron job if you have cPanel, make sure you copy it and paste it then replace the red highlighted fields with your own, do not add or take away any spaces or it will not work.

Add it inside the Command box field

mysql -u prefix_user -pPassword -h localhost -D prefix_database -e"TRUNCATE TABLE prefix_table_name"

This cron job will delete (truncate) the table you name.

Here is how this works:

-u = your mysql username

-p = your username's password

-h = local host

-D = your database to perform the cron job on

-e = is the actual command to give table within the database

You will then leave * for every field starting with the minute all the way to the weekday to make the cron job work every min...

It will be up to you to find out what command it is you are trying to make this cron job do.

Hope this helps you out...

p.s. Make sure you copy and paste this exactly how I posted it here, any extra spaces where they don't belong will break the cron job ....

--------------- Added 1380419552 at 1380419552 ---------------

If you have customer support you can also have them help you write up your cron job, this is just one example of a type of cron job you can set ...

--------------- Added 1380419848 at 1380419848 ---------------

If you can give me the host you are using I can probably help you with this further, there are cron jobs for different things like :

Command to run a PHP5 cron job:
php /home/username/public_html/cron.php

Optional flags are sometimes required for a PHP cron job:
php -q /home/username/public_html/cron.php

The list goes on and on ....