-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The repository provides roll call data from the California Legislature. The following describes how to set up a local version of the repository and use cron jobs to automatically update the data weekly.
To deploy the roll call updater, clone the repository in an appropriate location, for example:
user@machine:/var/data_builders$ git clone https://github.com/JeffreyBLewis/california-rollcall-votes.git
and add following two lines the following two lines to the crontab via crontab -e
# m h dom mon dow command
1 1 * * 7 /var/data_builders/california-rollcall-votes/scripts/california_rollcall_update
1 6 * * 7 /var/data_builders/california-rollcall-votes/scripts/push_log_update
(adjusting the paths and scheduled times as required). In this example, the update is run on Sundays at 1 AM and the resulting log file is updated six hours later to allow more than enough time for the update to occur. That's it.
The targets
package is used to manage the update workflow. The raw source material is only downloaded from the legislature if that resource has changed since last updated (by checking etags). The roll call data is only updated if new votes are taken.
The R scripts require the user running the cron job to be able to write to the folders of the repository (and also to the R's temporary directory). The scripts referenced in the crontab must be executable by the user running the cron job. The local git repository must also be configured such that the user running the cron job is able to push updates to GitHub.