Skip to content

Commit 468a84a

Browse files
author
root
committed
Samba4ad sysvol replication v1
1 parent 0bd45d7 commit 468a84a

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Configuring SysVol replication
2+
3+
Configure SSH keys so we can rsync automatically without any user interference. _**Do not use a passphrase**_
4+
5+
Create the key on the _primary_ domain controller
6+
```
7+
ssh-keygen -t RSA
8+
```
9+
10+
Copy the key to the secondary domain controller
11+
```
12+
ssh-copy-id root@tobiasdc02
13+
```
14+
15+
Just SSH in to make sure it's working correctly
16+
```
17+
ssh tobiasdc02
18+
```
19+
20+
Once we're in and confirmed the key is working we can log back out.
21+
```
22+
exit
23+
```
24+
25+
On our primary domain controller we can run the below command as a dry run to make sure that we're able to copy the sysvol folder.
26+
```
27+
rsync --dry-run -XAavz --chmod=775 --delete-after --progress --stats /usr/local/samba/var/locks/sysvol/ root@tobiasdc02:/usr/local/samba/var/locks/sysvol/
28+
```
29+
30+
If this looks correct then remove the --dry-run part
31+
```
32+
rsync -XAavz --chmod=775 --delete-after --progress --stats /usr/local/samba/var/locks/sysvol/ root@tobiasdc02:/usr/local/samba/var/locks/sysvol/
33+
```
34+
35+
Finally add an edit the crontab
36+
```
37+
crontab -e
38+
```
39+
40+
Paste in the following to sync every 5 minutes
41+
```
42+
*/5 * * * * rsync -XAavz --chmod=775 --delete-after --progress --stats /usr/local/samba/var/locks/sysvol/ root@tobiasdc02:/usr/local/samba/var/locks/sysvol/ > /var/log/sysvol-replication.log 2>&1
43+
```
44+

0 commit comments

Comments
 (0)