Cron Jobs / Tabs / Tasks And More
I'm building a site with a mySQL db behind it.
There are going to be a lot of records in it with products.
Now i have recently discovered cron jobs, and i thought it
would be a good idea to use those to backup the database.
i have a few questions:
- If i back up the database, does it put the backup
in an actual different db, or just in the same db but
other tables? (Silly question maybe, but i'm new to this)
- Can the DB still be queried bij site-visitors though it's
being backed up?
- Is it possible to just backup new/updated records instead of the
entire db?
- Imagine i backup once a month. can the cron job notice
if the DB is dameged/ has errors, so it'll stop backing up
so it doesn't overwrite the previous backup... or doesn't backup
delete the previous backup?
View Complete Forum Thread with Replies
Related Forum Messages:
Sending Mails Without Using Scheduled Tasks (crone Jobs)
Can we set up a mail program that the mail can sent frequently..ie may be daily or weekly or monthly... with out using scheduled tasks or crone jobs. for eg .. can we create a page that works like the scheduled tasks page( there we can set up the time at which time the program will execute )..that means we have options in our webpage to set up the time at which the mail will sent. for eg..every monday.. can we set up this in the program without using scheduled tasks or crone jobs. can we run our page frequently without using crone jobs .
View Replies !
Cron Tasks
I'm building an auction site which needs scripts automatically launched to scan the closing auctions. I'll use Linux's crontab. I'd prefer to avoid installing Php as a cgi and prefer to keep my apache module config. I'd also prefer to avoid the use of a browser as lynx to do this job because I fear the time-out How I can launch my scripts?
View Replies !
Cron/scheduled Tasks
Im running my site on a web server, and want to add something so that every hour the variable $gold = $gold*($workers*3.1) +($banks*30); and the way to do this is cron jobs from what ive gathered from searching google. BUT not only haven't i found a good tutorial, but I haven't found a single example taht isn't with CGI or a download.
View Replies !
Set Up Cron Jobs
I have to set up some cron jobs but I don't know anything about them, is there a place that someone knows of where i can learn about them? or tell me how to do them? another question, i'm also trying to set up a search for my site...how do u split up a sting so you can search for each individual word? for example if someone does a query for "billy boy", how do i split up the string so it can search for both words, "billy" and "boy", instead of just "billy boy"?
View Replies !
PHP Cron Jobs
I'm trying to set up a PHP cron job. The email i recieve to say that it's executed properly doesn't seem to like my comment codes and appears to be trying to find a file (reading the // as a file path presumably). Has anyone else had this problem? If so, how do i resolve it? Also are includes run in PHP Crons too? Perhaps this is causing my problem.
View Replies !
Cron Jobs & PHP
I am running the command: /aboslutepath/httpdocs/test3.php It tries to run the PHP as CGI. Is there a CGI command to include the PHP file? I use a simliar trick in my .shtml pages to run PHP. Any ideas?
View Replies !
Cron Jobs...?
I want to make a cronjob but am unsure how to create a cron.php script which is what the cronjob runs to perform the task. I want to make something that will email something like the number or visitors to my site, or what pages are viewed, or something like that. I guess there needs to be a script that collects data somehow, and then another to send it to me, but I dont know what to do to collect the data, I think i could figure out sending it once it's collected.
View Replies !
Cron Jobs
For a cron job would I have to use: A: <?php $conn = mysql_connect('removed','removed', 'removed'); mysql_select_db('removed',$conn); $delete = "TRUNCATE TABLE logins"; mysql_query($delete,$conn) ?> or $conn = mysql_connect('removed','removed', 'removed'); mysql_select_db('removed',$conn); $delete = "TRUNCATE TABLE logins"; mysql_query($delete,$conn
View Replies !
Run PHP Via Cron Jobs
I set up a bulk emailing service, but it is limited by my host. They only allow 100msg/hour. I coded a php script that will get 75 emails from database, and email them. I never worked with cron jobs, but I heard about it. If I can excecute this script once an hour, I'll be good. I was reading some stuff and no 2 of the codes I read were the same to excecute a php script every 1 hour, and they mentioned something about putting in a line to turn php into cgi.
View Replies !
Free Cron Jobs
My host does not support cron jobs, i doubt it, but is there any site that offers free cron jobs (ie: at 12:00 it will just open a page on my site)?
View Replies !
Perl, PHP, And Cron Jobs
I was told by a guy, "I may be mistaken, but I think you CAN access URLs from a perl script, so you could make a generic engine and run php programs from it". Is he mistaken? This is dealing with cron jobs. I'm not on an Apache server so I can't use the cron jobs to run php files. Only perl files, but it would be more convenient if I could just have a perl file run a bunch of php files I need rather than recoding my programs into perl format.
View Replies !
Cron Jobs Using CPanel
I use CPanel to control my site and I think cron jobs can do what I want on my site. I have a few questions: 1) How do you write a Cron Job to open a script on your website. 2) Can the script be in any language (PHP, Perl etc..) 3) If you can use PHP with it, would this script work? $selectall = mysql_query("SELECT * FROM users"); $selectall2 = mysql_fetch_array($selectall); while($selectall2){ $column1 = $selectall2['column1']+20; $column2 = $selectall2['column2']+80; $query = mysql_query("UPDATE users SET column1='$column1', column2='$column2'"); }
View Replies !
Creating Cron Jobs With PHP
I would like to set up a cron job that queries a game server every X seconds and then saves the info, so that later I can process the data to create a report of the game server. Code:
View Replies !
Secure Cron Jobs
I have a server with apache/cpanel 10. I started a new cron command which succeeds in calling a file: php /home/my_site/public_html/cron/messages_cron.php Problem: I don't want some random user trying to access the script. Therefore, I tried moving it into a different folder than public_html Example: php /home/my_site/cron/messages_cron.php Problem: I needed to include a file called core.php which was located in public_html, and I couldn't figure out a way to do so. Any ideas? I tried: require_once "../public_html/filename.php"; That didn't seem to work.
View Replies !
Running Cron Jobs
I set a cron job as running a php script at a certain time? For instance, set it to run a php script to update a certain set of fields in a table every 15 minites or so? I am having a hard time getting the tech support from my web hoster to answer my questions about path names. He isnt very forthcoming and has now given me 2 very different path setups, after over 2 hours of waiting for a response.
View Replies !
Host Doesn't Support Cron Jobs
Well, what I want to do is, run a script once every say, 30 minutes... basically run through a script and process every row in my database. Well... I figured a Cron Job was the easiest way to go about this... but my host doesn't support it at the moment. Is there any other way to get a script to run automattically without user intervention on a set time schedule?
View Replies !
Complex Timed Cron Jobs
Is there any way to set up complex timed cron jobs - ie I have a job that needs to run at 08:45 12:00 17:15 and 17:35 Without setting up individual cron jobs for each time?
View Replies !
Multiple Jobs From Single Cron
One of the web hosts that I use allows a single cron job to run. I need to run more than one scheduled job using this single launch. Now I could just include the jobs into the one cron job, but if one abended for any reason, then the second one wouldn't run. I have seen some posts advising the use of fork and others advising the use of popen. Ideally I'd like the initial cron job to read a database table and launch separate jobs based on entries in the table that would all run to conclusion independantly of each other. I'd like some ideas of what is the best way to accomplish this?
View Replies !
Cron Jobs With MMORPG Text
I lunched a new MMORPG text based game, but the player (turns) not working, the (turns) function in the game should be automatically run after 30 min. I tried to search the database bit can't find any information or tips to let the turns works, I setup a cron jobs as per the script information but also the (turns) didn't work. I got a hint from a friend that maybe the IP server is involved with the turns, is it true? And how I can let the turn's works?
View Replies !
And Cron Jobs. Mass Emailer.
I have about 1500 emails in my database, I have a made a script that will just loop the mail() command for all of them, but I don't want the script to run for over 30 seconds, otherwise it stops. What i would like to do, is run them through a cron job, so the script doesn't need to be up, and i can send them in cycles of a number that i can change online. I have never created a cron job before, and i don't have cpanel. So how can i go about making a php script that will create a cron job, then doing it.
View Replies !
Cron Jobs, Setting The Script Name To Be Dynamic?
I want to setup a cronjob to run a certain script, nothing different here. Normally you have to specify a url to the script and the script name, in order for the cron to run it. From my understanding the "cron" which does the "job" is a machine a server, with an ip..etc... This machine can run certain commands to execute and do different things. I want to make my script url dynamic by saying "http://urltoscript.php?time=CRONCOMMANDFORTIME" I know that this machine called the "cron" can execute a command to call a timestamp or read the current time..whatever I simply want to have it call the timestamp and echo it as part of the script url that is supposed to execute Is this possible? and if so could you show me a basic code to do this in "cron code" my second question is if this "cron" is indeed a machine or a server, does it accept cookies and sessions like a normal user surfing the web does?
View Replies !
Carry Out Function Every 24 Hours, Without Cron Jobs??
I'm trying to write a script which gets a random number every day, or 24 hours. I'm sure that the only way of doing this is using cron jobs, but I've checked with my host and they don't allow cron jobs Is there any other possible way of getting a script to activate every 24 hours?
View Replies !
CRON Jobs To Back Up MySQL Databases
I run a few CRON jobs to back up mySQL databases - nothing too intense. but I now need to run one which has to update over 19,000 records in a table. this will be run once every week - If I run the script in a browser window it causes a time out as it takes so long to process. would this happen in a CRON situation? the only way I could get this to work in the browser was to do 500 records at a time and get it to page through the process.
View Replies !
Trouble Including Relative PHP Files From Cron Jobs
I have a php file /home/mysite.com/httpdocs/admin_section/report.php that as part of the script includes another file ../connections/connect.php. Report.php works perfectly when I open it from a webbrowser (mysite.com/admin_section/admin.php), but when I run from my crontab or command line via: # /usr/bin/php /home/mysite.com/httpdocs/admin_section/report.php The report.php file then chokes on the include. "PHP Warning: main(../connections/connect.php): failed to open stream: No such file or directory in..." And the strange thing is this used to work before my server was upgraded by tech support. If I get rid of the relative path and include the full server path to connect.php, it works perfectly (but because I have a number of scripts like this, it isn't practical for me to change any of the PHP code). Any ideas on how I can fix this?
View Replies !
Cron Jobs With MMORPG Test Based Game!
I lunched a new MMORPG text based game, but the player (turns) not working, the (turns) function in the game should be automatically run after 30 min I tried to search the database bit can't find any information or tips to let the turns works, I setup a cron jobs as per the script information but also the (turns) didn't work. I got a hint from a friend that maybe the IP server is involved with the turns, is it true? And how I can let the turn's works?
View Replies !
Newbie Needs A Workaround - No Cron Jobs On Godaddy Shared Server!
I'm on the economy 'shared server' program with Godaddy. There's no root and no cron job available to me...ergh! I want to make a daily check on my mysql db (check a field to see if any users need to recieve a notification email). I called godaddy and they said there are no other tools available (on my plan) for scheduled tasks to run server side scripts. I've thought of a twisted workaround but want get some feedback on if there's a better/easier way. Here's my solution: 1. Have a scheduled task on my xp home box daily that points to a utility I have called iOpus File Downloader. 2. It will make downoad the php page on my site (I've already tested and it can do this) and write to a file on my local box. 3. The PHP will really function as a background process somehow triggering an action of emailing anyone who needs to recieve notifications today. However, it will echo a timestamp and since iOpus File Downloader writes the output of the page it downloads, I'll esentially have a log that my page was hit on that day. 4? I need some logic to make sure it ONLY checks the db once a day otherwise someone could hack me into making mulitple calls, etc. Perhaps a log file that logs <made_call_today>true</made_call_today><tstamp>'todaysdate'<tstamp>. Here's the current godaddy software: Operating System Red Hat Linux Kernal Version 2.4.21-4.0.1 elsmp Web Server Apache 1.3 Web Programming Languages PHP 4.3.11 Tomcat (Java) 5.0.27 CGI / Perl 5.8 Python 2.2 Frontpage 5.0.2.5012 Databases MySQL 4.0.24
View Replies !
Tabs
how can i get the values from 1 form to another without a submit button.. im using tabs to transfer from 1 form to another.. we decided to use tabs in order to avoid too much details on a single form.
View Replies !
Replacing Tabs...?
Is there a way to do $line = str_replace([tab], " ", $line; Where [tab] is a horizontal tab. I tried replacing ascii codes but couldn't get the thing to work, so any suggestions?
View Replies !
Replacing Tabs With |'s
Headache number 2 is here. I figure the customer isn't going to be too great at replacing tab characters with | characters for their flat file upload/export. I've been trying to find something that will convert tabs in my file to | character. I have tried str_replace, eregi_replace preg_replace and nothing is doing it.
View Replies !
Stop New Tabs
Is that a way through coding to stop people from opening 1000 tabs and just refreshing them. I would like to place a limit on the number of tabs someone can have open.
View Replies !
Tabs / Windows
there a way you could block the ability for somebody to have multiple tabs or windows opened on your website. I'm not exactly sure if this would be PHP related, Javascript related.
View Replies !
PHP Tasks
some times i get this error on my script: Internal Server Error i researched very much on why this error happens and i get to: i forgot to close some php tasks in my script. now i know only mysql_close() for closing one of php tasks. what are others php tasks that need to closing?
View Replies !
Tabs And New Lines And OUTFILE
I have a form with a textarea and users often include new lines and tabs in their entry (much like I am doing here) and also "quotes". When Selecting this table into the outfile (it is then ftp'd down for opening in Excel) the new lines and tabs are creating new rows. I have tried using different field delimiters like | [pipe symbol] which seems to help with the tab problem but does not solve the new line problem. I am reluctant to string replace as I store the data because keeping the spacing looks much better when the data is displayed on the web site.
View Replies !
Displaying Spaces And Tabs
I've got a problem that i'm not real positive on the cause, or the solution. I've got a few places on my page that people can enter in text - like the message board, and now a web column of sorts. I just have one or two problems. First, anytime someone enters more than one space, like at the end of a sentence, it always gets truncated down to just one. Second, i've no idea how to have a script display a tab. That is, something like indent the first line of a paragraph.
View Replies !
Bold And Tabs In Email
I am retrieving inputs from a form and then in my php script, I am concatenating these and using them to create the body argument for the "mail" command. I would like text like "EMAIL", "ADDRESS LINE" to be bold and also to have tabs in the email- please can anyone help? The code from the script is as below: $name = $_REQUEST[name] ; $email = $_REQUEST[email] ; $address_1 = $_REQUEST[address_1] ; $body = "NAME: $name EMAIL: $email ADDRESS LINE 1:$address_1" $sent = mail($to, $subject, $body, $headers) ;
View Replies !
How Can I Automate PHP Tasks?
I am currently running the same task multiple times a day and I'm sure there is a way to automate it. It is a simple one, but with limited PHP knowledge I'm not sure of the best way to do this. Here's what I need to do 1) log-in to a 3rd party site 2) Download the CSV 3) Upload to my db
View Replies !
Background Tasks
I'm using some weather rss feeds in a web site. The feeds are updated once every hour and cached in a local file. My problem is that every time the weather report is updating I get a long wait (not that long.. 2 or 3 secs) before the page is displayed. This happens becauses the teplate engine that parses the page is waiting for the weather section to be parsed and cached. Is there a ay I can start the weather parsing as a background thread and return immediatly to the template engine to continue to parse the page? And if so How?
View Replies !
Automated Tasks
I have an auction site running. Now I want the auction to be able to automatically send a mail msg to the seller after it expires. How do I do it? Obviously there is some sort of way that I can employ so that this task does not require an operator (such as me) to run manually. This task will involve accessing the database and sending an email. Can somebody enlighten me on this?
View Replies !
Directory Tasks
Im looking to do some work with directories. Basically, there are some directories which I want my website users to access fully, and see all the files in there. My server allows index of directories automatically, where users can see all the files in the directory (unless there is an index page). Code:
View Replies !
Referer For Tabs And New Browser Window
I have a site that I bring up in a tab on my IE browser. I log in which sets a session variable. If I then kill that tab, open a new tab and bring up the site again, I am still logged in. If I open a new browser instead, then I am not logged on....
View Replies !
Using PHP For Nightly Backend Tasks?
I have to develop a script to be run nightly to go through a database and send emails based on conditions. It's a large database, and there are several thousands of emails to be sent during the week everyday. The script will be run with a cron job at midnight or so. I was wondering if PHP is suitable for this, or may it be problematic, for instance would its execution abort after a certain amount of time? Or is it perfectly fine for this task?
View Replies !
How To Schedule Tasks On Website.
I am trying to figure out how to schedule tasks on my website. For example, PAGE1 should perform a different task in the morning than in the afternoon. And at the end of the day, I have to extract some data from the database and put them into a file. This should be done automatically.
View Replies !
Script In Windows Tasks
I would like to know how do i work with php in windows tasks. i developed a php web application and i would like to recieve to my email every day a certain report which will be produced by a php script.
View Replies !
PHP/mySQL Running Tasks Automatically?
I have a MySQL DB with all my client details (name, email address etc). I want to use PHP to retrieve records from the DB and email each of these clients (easy enough) BUT I want the system to automatically do this at pre-defined times. I have thought about using the UNIX/Linux CRON utility to perhaps call a PHP script that would retrieve specific records (based on a timestamp perhaps?) and then have it email based upon those records. Does this sound feasible? Are there better ways to do this?
View Replies !
Strip Comments, Tabs And Spaces From Scripts Prior To Deployment
I write a lot of comments in my PHP scripts, and I use tabs to indent different sections for readability and to keep things tidy. Until now, my scripts have been placed in production environments with all comments and "unnecessary blanks" included. PHP works fast when it comes to parsing big scripts, but I imagine that a little script compression would not hurt at all. What I would like to do, is to keep my source in one directory structure, and generate another parallel directory structure with compressed scripts for deployment to production servers. If anyone knows about existing software for this purpose, I would be glad to hear about it. But then again, making a PHP script to do the job does not seem like a difficult thing to do. Here is what I want it to do to my PHP scripts: 1) Remove comments 2) Remove leading and tailing tabs/spaces on each line 3) Remove blank lines If I read a script file into a string ($content), I can use preg_replace() something like this: Code: // Remove comments $content = preg_replace ("/(//|#).*/m", "", $content); // Trim spaces and tabs $content = preg_replace ("/(^[40 ]+)|([40 ]+$)/m", "", $content); // Remove blank lines $content = preg_replace ("/^[40 12 ]+/m", "", $content); So far this seems to work quite well. I know that formatting text with <PRE> in my scripts will be affected by this compact method, as it removes newline/linefeed from the source code. But I hardly ever use <PRE>, so I can live with that. Does anyone have comments on this method? Can these regular expressions do unexpected things to my PHP-code, leading to either parser errors or unpredicted actions/bugs?
View Replies !
Executing PHP Tasks While Letting A User Continue To Browse?
I was wondering if someone could help me out with the following two situations. In a lot of my web apps, it seems that if i launch a PHP script that takes a long time to complete, the user is unable to browse/use the rest of the website until the tasks completes. Is there a way to avoid this? Specifically, app #1 let's a user choose which files to include in a zip file, then PHP makes the .zip file on the server and streams it to the user via fopen/fread. So, as the user is downloading a file on the side (it presents them with the open/save dialog) they are unable to browse the rest of the PHP-based site until the download completes; clicking on any links to pages does nothing, the browser just sits there until the file has been downloaded, THEN the screen advances. I am experiencing a similar thing with a PHP mail delivery system. I tried to create a work-around: a pop-up window that sends an 'exec' command to the a php-script that sends the email to a few hundred recipients. Again, even though this action is being done in a pop-up window (and via the command line, no less), the user is paralyzed in the main window until the action completes.
View Replies !
PHP Jobs
I was wondering if any of you might have some advice. Until recently I worked for a software company and really enjoyed my job there. I moved with my wife to Colorado, and there are no software companies hiring (that I have found) in this area of Co. (I don't want to drive 1 1/2 hour to Denver each day). Do any of you have experience in freelance PHP work, is it a viable market?
View Replies !
|