might pay for this if it's to much work.

Posted on 2012-09-03
Last Modified: 2012-09-04
I am trying to make a pseudo cron job php script.

i found this site

but it write to a txt file how can i change it to write to a data base ?
Question by:armasmike
    LVL 15

    Expert Comment

    by:Jagadishwor Dulal
    What do you want to write in database the pseudo cron code or ???

    Author Comment

    I would like the code to not use a text file at all to store all the info and read the info from a db.
    LVL 33

    Expert Comment

    greetings   armasmike, , I looked at the code for the pseudo-cron  job , that you gave a link to, and I do not nderstand your question, based on what this pseudo-cron is designed to do.
    First, the pseudo-cron  does write to a text file as a "Log" recorder (maybe only in DEBUG mode). . It uses a rather bad way to record job "LastRun" time, by using a time modified on a "Job" file, not sure if it actually writes anything to that file. So the code that I looked at does not do any Data writes to a file, that I noticed.

    What this does do, , is READ a text file, that has a list of PHP files that you want to run as cron jobs, and reads a date and time for the cron-job, and tests if the scheduled time, is in the past or future, if it is in the past, it calls -

    the  $job[PC_CMD]  would be the PHP file name and Path , like -

    If you are wanting to do a cron job list - READ - from a Database, instead of a file, it would require several many changes to the pseudo-cron code, and may take some effort, just working through this pseudo-cron code for and over view, took some time for me.
    But as far as I can see, it uses a File to read the job list from, so you can set-up and change the cron jobs, by writing your cron job list to file , or change the cron job list file.
    You may have a good reason to want a database read, but I can not think of any reason not to use the file read that this is set up to do.

    ALSO, it is my opinion that this uses an Older PHP coding style, with alot of  GLOBAL variables, which these days are considered Bad PHP coding?

    Author Comment

    Thank you for your input i am trying to make a plugin for a cms program. Wordpress has one build in called wp-cron.php. That users and set jobs to run with out having to use crontab in there cpanel.

    This way the plugin can be install on a win server and still work. I am trying to find someone i pay or some free code that can be changed a bit for my plugin to work.

    If you have time or if you know some one that does i would be willing to pay to get this done.
    LVL 33

    Accepted Solution

    Sorry, I do not have time in the near future, to Redo this "pseudo cron job" code for a database, I would NOT want to use his code methods anyway. I would think that a "DataBase" use code might be tricky, because of the specific Table structure you would need to have in this May not be available in wordpress standard database tables, I can not see a "One Size Fits All" Table read write code as very possible for this kind of thing. I would think that someone would need to do alot of testing and error checking to make a successful WordPress Database Cron-Job plugin that works in different situations.

    I do not know anyone that can do this at this time. There is a section in EE where you can hire an EE expert.

    Author Closing Comment

    Thank you i will look at hiring a EE expert

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    The purpose of this article is to demonstrate how we can use conditional statements using Python.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now