General

Scheduled TasksHow to Add a Pay GradeRemoving Duplicate UsersHow to Add an Asset TypeHow to add a PropertyHow to add PermissionsImport or Export SpreadsheetsNoticesAdd a Data EntityRestrict Services in DependenciesHow to View the Change LogHow to Add a Charge GroupHow to Add a PositionHow to Add a MetricHow to Add EquipmentView Associated Services

Scheduled Tasks


The following scheduled tasks are needed:

Database backup

Cron snippet

58 23 * * * cd /var/www/serviceview/bin; /usr/bin/php backupDatabase.php

The backup database script can be run at any time to create an immediate backup of the database. This is useful to do before spreadsheet imports or before any major data reworks.

The script will by default store backups in the ../backup directory. It will keep the last 8 days on backup and a backup for each month. In addition a quarterly snapshot is created and stored in the ../backup/snapshots directory.


Updating Time Zones

Time zone updates are needed for cities that use daylight savings and require a time change. Time zones are retrieved from a Google API based on their longitude and latitude.

Cities longitude and latitude are pulled from the file /bin/TimeZones.csv

Cron Snippet

50 1 * * * cd/var/www/serviceview/bin; /usr/bin/phpupdateTimezones.php<</tmp/exports.txt

Copying the Database to Another ServiceView Instance,/h2>

Should you want a test or development instance of ServiceView the following script will copy the production database every hour. Some parameters can be changed after the database is copied by adding SQL statements in the script.

Cron snippet

* * * * * cd/var/www/serviceview/bin; /usr/bin/phpcopyDB.php<</dev/null

Other Scheduled Tasks

Monitoring, collecting data and seding SMS are all performed in one script to return every minute. The script works out what jobs are needed.

Cron snippet

* * * * * cd/var/www/serviceview/bin; /usr/bin/phprunCron.php<</ev/null

Sample Cron

It is recommended the following cron is used running under root.

58 23 * * * cd /var/www/serviceview/bin; /usr/bin/php backupDatabase.php
50 1 * * *  cd /var/www/serviceview/bin; /usr/bin/php updateTimezones.php << /tmp/timezones.txt
0 * * * *   cd /var/www/serviceview/bin; /usr/bin/php copyDB.php << /dev/null 
* * * * *   cd /var/www/serviceview/bin; /usr/bin/php runCron.php << /dev/null
.