(Manage a weekly status report)


weekly [-fhnv] [date]


Perl 5.003 or later and News::Article. Date::Parse (part of the timedate distribution) is required if a date will be given on the command line.


weekly is part of a status reporting system that periodically sends e-mail updates about what one has accomplished. It's intended to run as a weekly cron job to send status reports at the end of each week. It performs a few checks before sending the status report to see if it looks ready for sending and complains if it isn't, thereby acting as a reminder to finish the report.

Inside its report directory, set at the top of the script, should be three files: current, which is the status report for the current week; next, which is the projected to-do list for upcoming weeks; and report, which is a News::FormArticle template used to generate the e-mail message containing the weekly report. When weekly runs, it generates a report using the report template and including the contents of current and next, archives current, and then renames next to todo. todo must therefore be renamed back to next, indicating the next report is ready for sending, before weekly will send another report.

The report template may contain the following variables:


Replaced by a string giving the dates of the weekly report. This will be two dates, separated by - , with each date given as a three-character English month followed by the day of the month as an ordinal. The current day is used as the end date of the report unless a date was specified on the command line, in which case that date is used. The start date is always four days earlier than the end date (so Monday if the end date is a Friday).


Replaced by the contents of the current file.


Replaced by the contents of the next file.

For weekly to be happy sending a report (if run without any options), current must be modified within the past twelve hours and next must exist.

Old reports are archived after being sent. Those archived reports are saved in directories named after the year. Each old report will be stored as a file named YYYYMMDD in the archive directory for that year. The date will be the date of the last day of the report.

weekly can also take a date argument on the command line (in any form parsed by Date::Parse), which will be used as the last date of the report instead of the current day if present. If a date is specified, no checks are made for whether current is recently modified.


-f, --force

If todo exists in the report directory but next does not, rename todo to next and then continue as normal. This flag can be used if you don't want to have to manually rename todo to next to signal that the report is ready each week, or if you're sending the report by hand.

-h, --help

Print out this documentation (which is done simply by feeding the script to perldoc -t).

-n, --dry-run, --just-print

Rather than sending the mail report, print what would be sent to standard output. If this option is given, the report also won't be archived and next will not be renamed to todo.

-v, --version

Print out the version of weekly and exit.



The default report directory, set at the top of this script. It is expected to contain the current, next, and report files as described above.


The report period isn't configurable, nor is the language for encoding the dates (which since they use ordinals isn't quite as easy as it sounds).


The current version of this script is available from Russ Allbery's script page at <http://www.eyrie.org/~eagle/software/scripts/>.


Russ Allbery <rra@stanford.edu>


Copyright 1998, 1999, 2008, 2009 Board of Trustees, Leland Stanford Jr. University.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

Last spun 2013-07-01 from POD modified 2009-07-11