There are various cron scripts which the onShore TimeSheet administrator can chose to run, depending on what your business' needs are. For example, at onShore, Inc. we have a separate business database for contacts invoicing and project tracking, so there are various scripts we've included in this distribution for exporting hours entries and jobs from PostgreSQL to a flat text file suitable for importing into this other database. In addition to those scripts, there are also scripts for backing the database up, which is described in a separate section, and advising supervisors that they have unapproved hours. This section will briefly describe the various scripts and suggest crontab entries for enabling automated operations. In a default installation these scripts can be found in /usr/sbin.
As previously mentioned, on all installations there are no crontab entries created that will run by without explicitly enabling them. If you are not installing this on a Debian Linux system, the onShore TimeSheet administrator will need to create the crontab entries from scratch. Below the descriptions for the scripts you will find suggested standard crontab entries for enabling the script as an automated operation.
timesheet-daily-report:
Reports to supervisors through e-mail. The supervisor daily report includes a summary of unapproved hours, and a summary of open jobs managed by the supervisor.
This is an example crontab entry, which will send off the reports at 1:00am every night:
0 1 * * * /usr/sbin/timesheet-daily-report
timesheet-export-hours:
Exports the hours which have been marked approved in the database, and marks the hours as "download" (and therefore not editable so the records cannot get out of sync with the other database).
This crontab entry will export hours data every weekday night at 2:00am:
0 2 * * * /usr/sbin/timesheet-export-hours
timesheet-export-jobs:
To be written.
timesheet-export-hours:
Exports any jobs which have been created since the last time was run, and marks them as "downloaded" (and thus not needing to be downloaded again), for importing into another database. Jobs are editable after being marked as "downloaded".
This crontab entry will export the new jobs data every weekday night at 1:30am:
v30 1 * * 1-5 /usr/sbin/timesheet-export-jobs
timesheet-dump:
Exports tables in the database using PostgreSQL's pg_dump (1) command for backup purposes. The text files produced contain the necessary SQL commands for re-creating the database from scratch and importing the information in the tables.
This crontab entry will export the full database every Friday evening at midnight for backup purposes:
0 0 * * 5 /usr/sbin/timesheet-dump
timesheet-load:
Imports the tables dumped from timesheet-dump into the PostgreSQL database for restoration purposes.
There is no example crontab entry, as this shouldn't be an automated operation.