-1

I have php file that generates my sitemap.xml file according to DB. I have a cron job that run this php script every month. How can I protect the php file, so only cron can run it, or certified user?

(I guess I cannot add login script, and session parameters to verify the user, because I want to enable running on cron, is that correct?)

Atara
  • 99
  • 1

1 Answers1

0

Ensure that your script has suitable group and world permissions that give only the access that is needed. Within the script you can have it check for the UID and or GID of the user running it. When allowing it to access the database give the accessing user readonly permissions.

user9517
  • 115,471
  • 20
  • 215
  • 297