Size: 7647
Comment:
|
Size: 7810
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 81: | Line 81: |
syncevolution --sync refresh-from-client gcal workcal }}} {i} For the first-time sync it is strongly recommended to use '''-- sync refresh-from-client''' or '''--sync slow''' option during the sync to avoid duplicity. |
syncevolution --sync refresh-from-remote gcal workcal }}} {i} For the first-time sync it is strongly recommended to use '''-- sync refresh-from-remote''' or '''--sync slow''' option during the sync to avoid duplicity. |
Line 99: | Line 99: |
|| refresh-from-remote || Deletes everything on client & replaces with server || || refresh-from-local || Deletes everything on server & replaces with client || |
Introduction
We are going to synchronize google-calendars(Personal, Work) with evolution calendars (Personal, Work) respectively.For shake of simplicity we took similar name for these calendars.
These following commands are documented assuming one is using the latest version of syncevolution (syncevolution >=1.32)
Sync Scenario
Google Calendar |
Evolution Calendar |
Source |
Database |
Peer |
Work |
Work |
workcal |
Work |
gcal |
Personal |
Personal |
personalcal |
Personal |
One can choose any arbitrary peer name.
Setup
Synchronization between work calendars is shown here
1. Create a Peer for Google calendar (gcal)
syncevolution --configure --template Google_Calendar username=YOURUSERNAME@gmail.com password=**** target-config@gcal
Here Google_Calendar template is used. One can also use webdav template. To list the known configuration templates run following commands at terminal-prompt:
syncevolution --template ?
2. Create a new source for work calendar
syncevolution --configure backend=evolution-calendar database=Work @default workcal
3. Add a remote database to the source (workcal)
syncevolution --configure database=https://www.google.com:443/calendar/dav/GOOGLRCALENDARID@group.calendar.google.com/events/ backend=caldav target-config@gcal workcal
Replace GOOGLECALENDARID with your own google-calendar id for work calendar. To find the required calendar-id go to google-calendar. Hover mouse over respective calendar, click down arrow & select settings.Then copy the calendar id as shown in the following image:
4. Connect remote calendars with local databases (sync-config)
syncevolution --configure --template SyncEvolution_Client syncURL=local://@gcal username= password= gcal workcal
5. Add a local database to the source (workcal)
syncevolution --configure sync=two-way database=Work gcal workcal
To list all local databases run following command at terminal-prompt:
syncevolution --print-databases
6. Check whether configured properly (Optional)
To check whether all configuration is working properly one can print all items in local or remote databse.
To print all items(calendar events) in local database run:
syncevolution --print-items gcal workcal
To print all items(calendar events) in remote database run:
syncevolution --print-items target-config@gcal workcal
7. Start syncing (First-Time)
syncevolution --sync refresh-from-remote gcal workcal
For the first-time sync it is strongly recommended to use -- sync refresh-from-remote or --sync slow option during the sync to avoid duplicity.
Caution: "refresh-from-client" option WILL DELETE EVERYTHING IN EVOLUTION CALENDAR (for caldav/carddav client is remote server & server is local client i.e. syncevolution) AND REPLACE WITH GOOGLE-CALENDAR.
To find all possible sync-option run following command at terminal-prompt:
syncevolution --sync ?
General sync-options are explained below:
Sync Option |
Meaning |
two-way |
Normal two-way sync |
slow |
Exchange all data. Recommended for first time sync to avoid duplicity |
refresh-from-remote |
Deletes everything on client & replaces with server |
refresh-from-local |
Deletes everything on server & replaces with client |
refresh-from-client |
Deletes everything on server & replaces with client (opposite for caldav/carddav) |
refresh-from-server |
Deletes everything on client & replaces with server (opposite for caldav/carddav) |
8. Start Normal Sync (After first sync)
syncevolution gcal workcal
This will start two-way sync which is the default sync-option defined in step 5.
For other calendars repeat steps 2,3,4,5,6 & 7 with separate data-source & calendar-id for each calendar.Multiple data-sources can be synced at the same time:
syncevolution gcal workcal personalcal
To sync all sources under a peer run:
syncevolution gcal
Restore from backup
One can go back to original state if anything goes wrong during the sync. SyncEvolution automatically creates backup for each sync-session & saves as logdir(log directory) to '~/.cache/syncevolution.
To list all sessions for the peer gcal run following command at terminal-prompt:
syncevolution --print-sessions --quiet gcal
The output would be something like this:
/home/$USERNAME/.cache/syncevolution/gcal-2013-01-31-19-56 /home/$USERNAME/.cache/syncevolution/gcal-2013-05-16-20-57 /home/$USERNAME/.cache/syncevolution/gcal-2013-05-16-21-50 /home/$USERNAME/.cache/syncevolution/gcal-2013-05-16-21-52 /home/$USERNAME/.cache/syncevolution/gcal-2013-05-22-12-59 /home/$USERNAME/.cache/syncevolution/gcal-2013-05-26-14-05 /home/$USERNAME/.cache/syncevolution/gcal-2013-05-28-14-30 /home/$USERNAME/.cache/syncevolution/gcal-2013-05-29-23-08 /home/$USERNAME/.cache/syncevolution/gcal-2013-05-29-23-47 /home/$USERNAME/.cache/syncevolution/gcal-2013-05-30-19-45
What we need here is the session directory path which is /home/$USERNAME/.cache/syncevolution/gcal-2013-05-30-19-45 (last sync session) from the above example. On can restore either after or before the sync for each sync-session except the last.
The default restore command with all parameters looks like this:
syncevolution --restore <session directory> --before|--after [--dry-run] [--] <config> <source>
Remove --dry-run option option to write data to evolution-data-server. However it is recommended to pass --dry-run option (before running without it) to view all calendar events that are going to be restored.
For example, to restore workcal before last sync-session run:
syncevolution --restore /home/$USERNAME/.cache/syncevolution/gcal-2013-05-30-19-45 --before gcal workcal
To restore all sources under gcal run:
syncevolution --restore /home/$USERNAME/.cache/syncevolution/gcal-2013-05-30-19-45 --before gcal
Other Command-Line Usage
List all databases:
syncevolution --print-databases
List all sessions under a peer:
syncevolution --print-sessions --quiet gcal
Show information about configuration(s):
syncevolution --print-servers|--print-configs|--print-peers
either use --print-servers OR --print-configs OR --print-peers
Show information about a specific configuration:
syncevolution --print-config --quiet gcal workcal
List local calendar items:
syncevolution --print-items gcal workcal
List remote calendar items:
syncevolution --print-items target-config@gcal workcal
Prints what changes were made locally since the last synchronization:
syncevolution --status gcal workcal
Remove a config/peer:
syncevolution --remove gcal
Create, update or remove a configuration:
syncevolution --configure <options> [--] <config> [<source> ...]
To view all command-line options go to syncevolution-usage wiki page.