Periodic tasks

The renewals command is intended to be run as part of an automated script run at least once a day. It will

  • recognize revenue for past periods (see ledger).

  • extends active subscriptions

  • create charges for new periods

  • trigger expiration notices

Every functions part of the renewals script are explicitly written to be idempotent. Calling the scripts multiple times for the same timestamp (i.e. with the --at-time command line argument) will generate the appropriate Transaction and Charge only once.

Example cron setup:

$ cat /etc/cron.daily/renewals
#!/bin/sh

cd /var/*mysite* && python manage.py renewals