How to bulk create an extra node for each user I need to create an additional node for each authenticated active user on a Drupal 7 site. 

The nodes will be populated with default content from taxonomies, and also with some field content based on content owned by each user.  

Something like :


create node with author=user1
field 1= populated from a taxonomy 
field 2= Count of number of nodes of content type A authored by user1 that are
published 
field 3= current date


And then loop through all active users creating a similar node for each one.

What's the best way to handle this?  Ideally I'd like to do it in a way so that the batch node creation job could be triggered by a scheduled Rule in future. 

The idea is to provide a report showing a snapshot of the account status at a fixed time.
Shouldn't be too difficult if you're ok with writing a custom module, I can't think of any other way to iterate through your user base.


Create the node type for storing your statistics with:


Title (compulsory, unfortunately.  consider using Automatic Nodetitles)
Entity Reference field that references a user
Date field for storing the date
Other field/fields to store your statistics

Write a custom module that does the following things:


Iterate through all of your users
Check to see if the user is active
Queries the database to see how many nodes the user has.
Creates a new node containing the information you wish to store.



See how you go and of course ask more, detailed questions about each step showing what you have tried if you really can't work it out through the documentation and existing questions/answers available here and elsewhere.