Year-end SCR Archiving

Archiving of the Student Competency Records for a given year can be accomplished by running a script on the server.

First, get the XLS Export spreadsheet from your instance of CanDo: Log in as manager, click Manage, then click XLS Export. Your browser will download a spreadsheet called 'export.xls'. Open this file and make note of the ID on the School Years sheet of the year you wish to archive. You will need this when you run the script below.

Now copy the export.xls to your home directory on you CanDo server. Whatever tool you use to copy backups from your server should work fine for this.

With your export in place and the School Year ID at hand, log into your server's command line, download the script, and take a look at the help:

$ wget http://students.gctaa.net/cando-archiver.py
$ python cando-archiver.py --help

Usage: cando-archiver.py [options]

Downloads and archives CanDo reports.

Options:
  -h, --help            show this help message and exit
  -x XLSFILE, --xls=XLSFILE
                        Location of exported Excel file
  -y YEARS_REQ, --year=YEARS_REQ
                        Years to be archived.
  -u USER, --user=USER  Admin user ID on server.
  -p PASSWORD, --password=PASSWORD
                        Admin user password (will be
                        visible in terminal).
  -s SERVER, --server=SERVER
                        Server URL (including "http://" or "https://")
  -o OUTPUT_LOC, --output=OUTPUT_LOC
                        Location of reports

XLSFILE is the spreadsheet you just copied to your server, by default 'export.xls'. YEARS_REQ is the School Year ID you made note of, usually something like '2010-2011'. USER should be 'manager', and the PASSWORD you should know. If you have set up your server as recommended on this site (i.e., proxied over Apache with SSL) the server should be 'https://127.0.0.1'. It may also be possible to access the server at 'http://127.0.0.1:7090'. OUTPUT_LOC is the name of the directory that will be created to hold the archives.

To archive, run the script, substituing file names, etc. as necessary:

python cando-archiver.py -x export.xls -y "2010-2011" -u manager -p mysecretpassword -s https://127.0.0.1 -o reports

If you wish to archive and compress the reports so that they can be moved easily to another machine, try:

tar czf reports.tar.gz reports