Hello. What parameters should I run Cron to make the PHP script work only after authorization? The problem is that the login and password are not transmitted through the address bar ... There is a redirect to the page with the authorization form and after it is already returned to the script. Maybe I can somehow specify the login / password directly in the cron settings? (used by ISPmanager 4.4 Professional) Thank you!

  • By the way, can the script at the very beginning register authorization data in the session? Ie, so that the script authorizes itself at startup. One user. It is created as a superuser specifically for Cron .. Will this option work? - LexXy
  • Usually, web is not used for cron scripts. And authorization is therefore not needed. - ilyaplot
  • All hemorrhoids due to the fact that I work with a self-written CMS. There is no documentation for it ... - LexXy

1 answer 1

On the server you can do so

*/15 * * * * php /home/test.php 

If not, then you need to save the cookie from the browser and use wget

 */15 * * * * wget -U="MOZILLA/5.0"--save-headers -d -o log1.txt --load-cookies cookies.txt --keep-session-cookies \ -i file --cookies=on 
  • * / 15 * * * * - is this the path to wget / php? - LexXy
  • 2
    this is the cron problem interval - Alexey Shatrov
  • cookie.txt should be this? - LexXy
  • site.ru TRUE / FALSE 1388260916 admin_id 8 site.ru TRUE / FALSE 1388260916 admin_hash 8c48ct3ctn3cn3t3n3oc - LexXy
  • one
    @ Lex_1992 To get started, run the command in the SSH console. Once everything works , you can add the task to the crontab - ilyaplot