Created
January 9, 2022 14:22
-
-
Save fhdalikhan/b55e7782f29f2e9b49e5e5f45a86f29e to your computer and use it in GitHub Desktop.
recursively change folder ownership by either cron or PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cron example | |
* * * * * /usr/bin/sudo chown -R GROUP_NAME:USER_NAME /home/fahad/upload_testing/ | |
# php example, needs the user password and user has to have root permissons | |
system('echo THE_USER_PASSWORD | /usr/bin/sudo -S chown -R GROUP_NAME:USER_NAME /home/fahad/upload_testing/'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment