I would like to copy login data from one table to another.
- table contains Joomla login data
- table contains phpFox login data. I would like to copy login data from table 1 in every 30 seconds / 1 minute to table 2.
This is simple enough. Just write a query that does the action you want and save it as a .sql
file. Then enter crontab -e
at the command line to begin editing your crontab. The Ubuntu docs have good instructions for editing crontabs, but your final line will probably look something like:
* * * * * mysql --user=your_dbuser --password=your_password --database=zero < /path/to/your_query.sql
If you want to share users informations database from a master to other(s) Joomla website(s), there's a better solution.
The only requirement is all databases must be located on the same server + Joomla 2.5.x!
Open PhpMyAdmin and apply this modifications :
xxxx1... are tables from master site
xxxx2... are tables from client site
DROP TABLE xxxx2_session
DROP TABLE xxxx2_usergroups
DROP TABLE xxxx2_users
DROP TABLE xxxx2_user_notes
DROP TABLE xxxx2_user_profiles
DROP TABLE xxxx2_user_usergroup_map
CREATE VIEW xxxx2_users AS SELECT * FROM xxxx1.jos_users
CREATE VIEW xxxx2_session AS SELECT * FROM xxxx1.jos_session
CREATE VIEW xxxx2_usergroups AS SELECT * FROM xxxx1.jos_usergroups
CREATE VIEW xxxx2_user_notes AS SELECT * FROM xxxx1.jos_user_notes
CREATE VIEW xxxx2_user_profiles AS SELECT * FROM xxxx1.jos_profiles
CREATE VIEW xxxx2_user_usergroup_map AS SELECT * FROM xxxx1.jos_usergroup_map
If you want to run cron from default phpfox function then see phpfox_cron
table in your phpfox
database.