wvsurveyor Posted December 20, 2007 Share Posted December 20, 2007 I have two php scripts running as cron jobs. One script runs every 10 minutes and the other runs at midnight and 5 pm so at those two times they are running at the same time. I was having a problem with files being uploaded to the wrong clients directory and figured out that it only happens when the two scripts run at the same time. Both scripts have the function uploadfile() the script that runs every ten minutes checks to see if there is a file to upload and uploads it if there is. The script that runs at midnight and 5pm checks for for files to download from another website and use to have a call to the uploadfile() function but it was commented out and both scripts shared some common variables. Is it possible that because both scripts were running at the same time that their variables and functions are part of the same session? I changed the one script to run at 12:05 am and 5:05 pm and I am hoping this will correct the error plus I removed the uploadfile() function and variables so that their is no chance of them being shared. Just curious to know if it is possible. Quote Link to comment https://forums.phpfreaks.com/topic/82453-php-as-cron-job-two-different-scripts-running-at-the-same-time-share-functions/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.