Jump to content

Php Sleep


Markhad

Recommended Posts

Sorry, php dummy but need a bit of advice. I am writing a website and need to chmod a bunch of server side folders after a period of around 10 minutes incase the users close the web page before it has a chance to do it naturally at the correct time.

 

My thought is to periodically (cronjob every 15 minutes) a php script that loops through each folder and chmod it after using the sleep function for 10 minutes. This means that only folders which are 10 minutes old will be chmod and the newer ones will be left until the next cronjob.

 

Is this going to drain processing of the cheap shared host I am using or does it use the sleep quietly in the background?

 

Hope this make sense and thanks in advance!!

Link to comment
Share on other sites

Becuase i am using google document viewer which requires 755 but don't want the folder publically available so I chmod, load gdv then chmod it again to 754 after 10 seconds. However, if the user closes the page at the wrong moment the folder will still be open. Therefore periodically I want to rn through each folder and chmod it but not instantly( hence 10 minutes) as it could mess up if the user is still using the folder.

 

I hope that makes sense. I hav spent hours researching htaccess but there doesn't appear anyway of blocking out all except gdv as its ip is not static although I have secured it somewhat with htaccess preventing dir search as the folders I create are very long unique numbers and difficult to guess.

Edited by Markhad
Link to comment
Share on other sites

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.