Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved [How To?] Task Manager
#1
Not Solved
Is it possible for the task scheduler to execute the script without the forums being in use? Rather than someone have to constantly use the forum for the scripts to run on time?
Reply
#2
Not Solved
not sure that is possible. as you might be knowing, you have to use cron jobs at server level for such tasks.
Reply
#3
Not Solved
So would I have to create my own code to allow this to happen, I am running a plugin that allows forum groups to be synced with teamspeak 3 server groups and I want the script to run every 5 minutes regardless of server action
Reply
#4
Not Solved
^ if you are comfortable in coding then better to make it yourself. or you may post request with details at R/S/J section
Reply
#5
Not Solved
Make sure that task.php from the main directory is being executed. See examples for cron and systemd timers, respectively: https://docs.mybb.com/1.8/administration/task-manager/, https://community.mybb.com/thread-211078...76530.html
devilshakerz.com/pgp (DF3A 34D9 A627 42E5 BC6A 6750 1F2F B8AA 28FF E1BC) ▪ keybase.io/devilshakerz
Reply
#6
Not Solved
I set up a cron job to hit task.php every few minutes.
Reply
#7
Not Solved
It does not seem to work if I try to make a cron to run task.php

I have also tried to setup a different cron that will run teamspeak3.php (one of my scripts in my task manager) but that does not work either
Reply
#8
Not Solved
(06-29-2017, 07:12 PM)HCStrike Wrote: It does not seem to work if I try to make a cron to run task.php

I have also tried to setup a different cron that will run teamspeak3.php (one of my scripts in my task manager) but that does not work either

Your cron job needs to call it as a URL (eg. with wget or curl) instead of acting like task.php is a local PHP file.

Here's my /etc/crontab entry:
*/2 * * * * myself wget -O /dev/null http://www.mydomain.com/forums/task.php > /dev/null 2>&1

Replace myself with your username and verify the URL to your forums.
Reply
#9
Not Solved
(06-29-2017, 02:43 PM).m. Wrote: not sure that is possible. as you might be knowing, you have to use cron jobs at server level for such tasks.

(06-29-2017, 10:11 PM)laie_techie Wrote:
(06-29-2017, 07:12 PM)HCStrike Wrote: It does not seem to work if I try to make a cron to run task.php

I have also tried to setup a different cron that will run teamspeak3.php (one of my scripts in my task manager) but that does not work either

Your cron job needs to call it as a URL (eg. with wget or curl) instead of acting like task.php is a local PHP file.

Here's my /etc/crontab entry:
*/2 * * * * myself wget -O /dev/null http://www.mydomain.com/forums/task.php > /dev/null 2>&1

Replace myself with your username and verify the URL to your forums.

Thanks for the help, if I have a php file in my /inc/plugins/ directory, how can I setup cron for that?
Reply
#10
Not Solved
(06-29-2017, 10:26 PM)HCStrike Wrote: Thanks for the help, if I have a php file in my /inc/plugins/ directory, how can I setup cron for that?

Is it a plugin? Plugins have a different structure than other PHP files. When you directly access a PHP file in a browser, it executes code that is outside any method or class. All code within a plugin should be in appropriately named methods (such as plugin_info or plugin_run).

If it's not a plugin, it should be in a different folder.

*/2 * * * * myself wget -O /dev/null http://www.mydomain.com/forums/task.php > /dev/null 2>&1

Look at this cron job definition.

*/2 * * * * means to run every other minute of every day of every month regardless of day of week.

myself is the user this cron job should run as. You could run as root, but probably not a good idea.

wget is used to fetch a web resource
=O /dev/null means to save that resource to nowhere
http://www.mydomain.com/forums/task.php is the URL of the resource. You need to change the domain name and possibly the directory of your forums. Many people are also moving to https instead of http.
> /dev/null 2>&1 means to ignore STDOUT (standard out) and STDERR (standard error)

For further help, I would need your forum URL.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)