If you don't have "... a data selector of 'all users' ..." in your rule (as in your question), then a possible solution is to make one available in an appropriately triggered Rules Event, as further detailed below.
Step 1: Trigger a monthly rule
Create a rule using the Rules Once per Day module to actually trigger a rule once a month (not day!). And add a Rules Condition "Day of the month" (which comes with this module also). Further configure this Rules Condition with an actual "*Day of month** (an integer between 1 and 31) to actually fit your needs. E.g.: if you specify 1
as your Day of month, this rule will be triggered on the 1st of every month.
As an example, have a look at this simplistic rule (in Rules export format):
{ "rules_monthly_email_reminder_to_admin_account" : {
"LABEL" : "Monthly eMail reminder to admin account",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules_onceperday", "rules" ],
"ON" : { "once_per_day" : [] },
"IF" : [
{ "rules_onceperday_condition_dayofmonth" : { "comparison" : "==", "monthday" : "1" } }
],
"DO" : [
{ "mail" : {
"to" : [ "site:mail" ],
"subject" : "Time for the monthly operations on the 1st of every month",
"message" : "It\u0027s the 1st day of the month again, time for the monthly operations ...",
"language" : [ "" ]
}
}
]
}
}
All this rule does, is to send an eMail to the site admin, on the 1st of every month, with a subject like "Time for the monthly operations on the 1st of every month" (and some eMail body that goes with it).
If you have the Rules UI enabled, and after you also enabled the Rules Ones per Day module, you should be able to just import the above rule in your own site.
Step 2: Create a view of all users to be processed
Create a view (using the Views module) of those users for which you want to "reset a field to 0" (as in your question).
Step 3: Make the monthly rule process all users
After you created such view, you can process the results of a VBO enabled view via Rules, by replacing the Rules Action in the rule from Step 1 like so:
- Load the VBO list of the users in your View.
- Add a loop to perform a Rules Action to "reset a field to 0" (as in your question), for each user contained in your Views result.
For more details, have a look at the tutorial "How to process the results of a VBO enabled view via Rules?".
hook_cron
function?