Markhad Posted October 18, 2012 Share Posted October 18, 2012 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!! Quote Link to comment https://forums.phpfreaks.com/topic/269645-php-sleep/ Share on other sites More sharing options...
requinix Posted October 18, 2012 Share Posted October 18, 2012 Hold on. Why do you need to chmod anything? Quote Link to comment https://forums.phpfreaks.com/topic/269645-php-sleep/#findComment-1386120 Share on other sites More sharing options...
Markhad Posted October 18, 2012 Author Share Posted October 18, 2012 (edited) 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 October 18, 2012 by Markhad Quote Link to comment https://forums.phpfreaks.com/topic/269645-php-sleep/#findComment-1386127 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.