Jump to content

PHP as cron job, two different scripts running at the same time share functions


Recommended Posts

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.