The situation was I wanted to set up cronjob for webserver on Ubuntu,
the php
/ python
script file would be several sql function,
then run automatically update multiple tables.
but after few research, I found:
First I try running scripts.php
on Ubuntu terminal such as
$ crontab -e
$ * * * * */usr/bin/php8.0 /var/www/myproject/scripts.php
but Ubuntu terminal return could not find driver
, tried re-install pdo-mysql
in above PHP just still there;
Currently running directly open the URL with browser.
$crontab -e
$* * * * * export DISPLAY=:0 && firefox https://localhost/project/cron/scripts.php
the .sh scripts
using;
#!/bin/bash
# Set maximum amount of remaining firefox processes here
MAX_PROC=2
let COUNT=$(pgrep firefox | wc -l)
for (( i=1; i<=COUNT-MAX_PROC; i++ ))
do
PID=$(pgrep -o firefox)
kill $PID
# sleep 3
done
terminal pkill
work like charm
30 0 * * * pkill -f firefox.sh
Another option python
selenium
since the browser needs be gone;
but there's new problem that says:
Browser is under remote (reason: Marionette)
and opening a blank page;
after few test even the blank page the scripts still work but blank;
After some work still need some help:
- How to upgrade
pdo_mysql
in cli-php
without modified apache-php
;
- What would be the proper way to disable
Browser is under remote
;
Welcome any suggestion,
Thanks for any help.
both Python
/ PHP
acceptable!