-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdokuwiki-sync.1
82 lines (82 loc) · 2.2 KB
/
dokuwiki-sync.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
.\"
.\" License: GNU GPLv2+
.\"
.TH DOKUWIKI-SYNC 1 "2017-09-30" "" "dokuwiki-sync"
.SH NAME
dokuwiki-sync \- backup/restore/synchronise dokuwiki trees
.SH SYNOPSIS
.B dokuwiki-sync
[\-n] [\-x] [\-v] [\-h] <command>
.RI [ file... ]
.SH DESCRIPTION
.B dokuwiki-sync
is a script to ease synchronising two dokuwiki trees possibly on different machines by exporting
that data and updating changes between two trees
.PP
Run
.B dokuwiki-sync -h
.BR
to see the full set of options
.SH OPTIONS
.TP
.BR \-n
: Dry-run print commands instead of executing them
.TP
.BR \-x
: Enabling tracing of shell script
.TP
.BR \-h
: Print this information
.TP
.BR \-v
: verbose mode - print out names of changed files
.SH Commands
.TP
.BR "backup <data> <tfile>"
Backup directory <data> into a tar file <tfile>
.PP
- A tar file is created as using sudo in order to preserve ownership/dates
.TP
.BR "restore <tfile> <dir>"
- Restore tar file <tfile> inside directory <dir>
.PP
Extracts the tar file <tfile> into a directory <dir> which will be created if it
doesn't exist.
.TP
.BR "rsync-diff <d1> <d2>"
- prints itemized list of files changed from <d1> to <d2>
.TP
.BR "rsync-update <d1> <d2>"
- rsync update changes from <d1> into <d2>
.TP
.BR "diff-summary <d1> <d2>"
- prints summary of changes between directories <d1> and <d2>
.PP
Typically you synchronise two dokuwiki trees by first backing up the data from one
tree via
.B backup
command. Then extracting it out with the
.B restore
command on the remote machine you wish to update with changes. Then you check what
changes are present using the
.B rsync-diff
command which usually is run as the owner of the dokuwiki data for access
permissions. Usually this is
.B www-data
You can use by running it from a bash shell under that required user. e.g.
.IP
.BR "sudo su -s /bin/bash www-data"
.PP
The
.B diff-summary
command will summarise the number of changes in each direction between the trees.
.PP
When you are comfortable with the changes you can update the changes from <d1>
on to the <d2> tree with the
.B rsync-update
command.
.PP
At each stage use the
.B \-n
option to print out what command it will run with out actually running them.
This let's use avoid surprises and understand exactly what it proposes to do.