Tuesday, 13 August 2013

cron job make directory visable

cron job make directory visable

I have a directory on the server - var/www/html/content - and I would to
give everything inside this directory, recursively, 755 permissions (or
maybe 757, that's not really important at this point) at exactly 9:30am
every day.
I thought the best way to do this would be to create a .php file that
contains something like;
$ chmod -R 757 var/www/html/content/
I'm guessing I'd need an su command in there to switch to root as well???
Then all I would need to do is set up a cron job through the command line.
Something like;
30 09 * * * /var/www/html/run-job.php
Is this about right? Is there a better way to do this kind of task? I've
never done anything like this before...

No comments:

Post a Comment