-
Notifications
You must be signed in to change notification settings - Fork 60
EN:Cli
This page covers the available CLI functions.
not yet documented:
- Timetracker.allBillable - Timetracker.searchDuplicateTimeaccounts - more Setup CLI functions - Calendar.importegw14 - Tinebase.processQueue
|
Creates a new admin user or activates an existing admin user. Allows to reset the admin password, too.
php setup.php --create_admin
Allows to change config values for all applications. If "app" param is omitted, config is set for Tinebase.
php setup.php --setconfig -- configkey=sample3 configvalue=value3 app=Addressbook
Update the database for all activated tine20 components. Can be invoked after upgrading instead of opening the setup-module in the browser.
setup.php --update
Synchronize user accounts and groups from LDAP/AD.
setup.php --sync_accounts_from_ldap
Backup data, config and files. You may choose what to backup and to include or exclude a Timestamp to the output file names.
setup.php --backup -- config=1 db=1 files=1 backupDir=/backup/tine20 noTimestamp=1
Restore data, config and files from a backup.
setup.php --restore -- config=1 db=1 files=1 backupDir=/backup/tine20
Update Import and Export definitions for all applications.
setup.php --updateAllImportExportDefinitions
undo changes made by users to records or un-delete them:
php tine20.php --method=Tinebase.undo -d -- \
record_type=Addressbook_Model_Contact \
modification_time=2013-05-08 \
modification_account=ACCOUNTID
Used to trigger asynchronus events like sending of alarm notifications. Can be called by a cronjob and does not need a username (it checks the cronuserid config).
php tine20.php --method Tinebase.triggerAsyncEvents
(--username user [optional])
Used to clear obsolete data from tables.
the following tables are supported atm:
- credential_cache - access_log - async_job
php tine20.php --username tine20admin --method Tinebase.clearTable credential_cache access_log -- date=2010-09-17
One can setup a cron job with dynamically created date by using linux 'date' command and providing a password. Mind the usage of quotes as provided in the example below. This allows the usage of special characters like '@' in username and/or password.
php tine20.php --username "tine20admin" --password "tine20password" --method Tinebase.clearTable access_log -- date=$(date -d -30days +%Y-%m-%d)
(tablenames) (date, only useful if table = access_log [optional])
Used to purge deleted records from tables (is_deleted == 1).
you can call it with specific tables or without tables to purge records from all installed application tables.
if date param is given, all records that were deleted before the given date (deleted_time) are purged.
php tine20.php --username tine20admin --method Tinebase.purgeDeletedRecords -- date=2010-09-17
One can setup a cron job with dynamically created date by using linux 'date' command and providing a password. Mind the usage of quotes as provided in the example below. This allows the usage of special characters like '@' in username and/or password.
php tine20.php --username "tine20admin" --password "tine20password" --method Tinebase.purgeDeletedRecords -- date=$(date -d -30days +%Y-%m-%d)
(tablenames [optional]) (date [optional])
Clean timemachine_modlog for records that have been pruned (not deleted!).
php tine20.php --username tine20admin --method Tinebase.cleanModlog
Clean relations, set relation to deleted if at least one of the ends has been set to deleted or pruned.
php tine20.php --username tine20admin --method Tinebase.cleanRelations
Used to add new customfields with acl for anyone by default.
php --username unittest --method Tinebase.addCustomfield -- application="Addressbook" \
model="Addressbook_Model_Contact" name="definedkeyfield" \
definition='{"label":"definedkeyfield","type":"keyField", "keyFieldConfig": {"value": {"records": [{"id": "LOW", "value": "Low"}, {"id": "MID", "value": "Mid"}, {"id": "HIGH", "value": "High"}], "default": "MID"}}}'
- application (the application of the cf) - model (the model which contains the cf, for example Addressbook_Model_Contact) - name (internal name of the cf) - definition (json encoded definition of the cf) -- label (label in the cf panel) -- type (string|int|DateTime|keyField|...) -- value_search (if this is 1, the cf becomes a combobox with a list of all values that are saved in the db for this cf) -- uiconfig: --- xtype (extjs xtype of the cf) --- order (for sorting, highest numbers are at the bottom) --- group (for grouping boxes)
php tine20.php --username tine20admin --method Tinebase.addCustomfield -- application="Addressbook" name="datefield" label="Date" model="Addressbook_Model_Contact" type="datefield"
- application (the application of the cf) - name (internal name of the cf) - label (label in the cf panel) - model (the model which contains the cf, for example Addressbook_Model_Contact) - type (extjs xtype of the cf) - value_search (if this is 1, the cf becomes a combobox with a list of all values that are saved in the db for this cf) - order (for sorting, highest numbers are at the bottom)
- textfield - datefield - datetimefield - extuxclearabledatefield - customfieldsearchcombo
Used to update import/export definitions in the database by reading the configuration from a file.
php tine20.php --username tine20admin --method Addressbook.updateImportExportDefinition importdefinition.xml
(filenames)
Several apps support imports via appName.import. Available plugins for the app could be found in the appName/Import directory. In the plugin files you also find an $_options array with a list of possible options.
php tine20.php --method=Calendar.import --username=me -v plugin=Calendar_Import_Ical container_id=362 /path/to/Feiertage_DE.ics
php tine20.php --method=Addressbook.import --username=me -v definition=adb_tine_import_csv /path/to/contacts.csv
This CLI function allows to set the grants of containers. You have to know the id of the container and the account/group or you need to supply a filter string for container names (operator: contains).
php tine20.php --method=Calendar.setContainerGrants containerId=3339 accountId=15 accountType=group grants=readGrant php tine20.php --username admin --method=Timetracker.setContainerGrants namefilter="ta title" accountId=3039,3038 accountType=group grants=book_own,manage_billable overwrite=1
containerId / accountId / accountType / grants / overwrite / namefilter
Imports file with contact data into the addressbook.
php tine20.php --username tine20admin --method Addressbook.import file.csv adb_tine_import_csv
(filenames) (import definition name)
Exports contacts.
Per default only exports the internal contacts addressbook. You need to set the required container id in the code (Addressbook_Frontend_Cli).
php tine20.php --username tine20admin --password tine20adminPw --method Addressbook.export > myExport.csv
no params
If you run into this problem you might want to try the following:
php -d memory_limit=512M tine20.php --username tine20admin --password tine20adminPw --method Addressbook.export > myExport.csv
Removes contacts that were created from a calendar sync.
php tine20.php --username tine20admin --method Addressbook.removeAutogeneratedContacts
Import new users. Accepts the same params as appName.import.
php tine20.php --method Admin.importUser --username=me -v definition=admin_user_import_csv /path/to/users.csv
Import new Groups.
php tine20.php --method Admin.importGroups --username=me -v definition=admin_group_import_csv /path/to/group.csv
create system groups for addressbook lists that don't have a system group.
php tine20.php --username "tine20admin" --method Admin.createSystemGroupsForAddressbookLists
Add missing lists and checks if list container has been deleted (hides groups if that's the case)
php tine20.php --username "tine20admin" --method Admin.repairGroups
Overwrite Samba options for users. You may set the Samba options in Admin/Frontend/Cli.php
php tine20.php --username "tine20admin" --method Admin.repairUserSambaoptions
--dry
Shorten loginnmes to fit ad samaccountname (20 Chars). And updates Samba options.
php tine20.php --username "tine20admin" --method Admin.shortenLoginnames
Exports all events of a calendar in ICS format.
php tine20.php --username "tine20admin" --password "tine20password" \ --method Calendar.exportVCalendar -- container_id=CALID filename=/my/export/file.ics
Import all events of a calendar in ICS format.
php tine20.php --username "tine20admin" --password "tine20password" \ --method=Calendar.import plugin=Calendar_Import_Ical importContainerId=123 calendarWithID123Events.ics
-
- System requirements
- Install Howto
- Update Howto
- FAQ
- Translation Howto
- Operation
- Integration
- Synchronization
- Migration
- Developers