wiki:cygwin_install_backuppc_rsyncd
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:cygwin_install_backuppc_rsyncd [2015/06/02 18:27] – jrdalrymple | wiki:cygwin_install_backuppc_rsyncd [2018/09/27 02:29] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | You have a directory | + | ====== Cygwin unattended for BackupPC ====== |
| + | ==== Introduction ==== | ||
| + | This is a howto describing an unattended installation of Cygwin including both Rsyncd and SSHD. Rsyncd is there to make your backup setup from the BackupPC server more simplified. No setting up SMB shares or any business, just use one master rsyncd.conf file with all of your shares for all of your servers and you're in business. The sshd is intended to allow you to execute remote commands. This can be useful if you want to dump a database or setup a VSC to pull from instead of being denied access to open files. [[wiki: | ||
| + | ==== Prerequisites ==== | ||
| + | * A central share to store all of your files - should be heavily but properly guarded | ||
| + | * Administrative rights and the ability to use psexec to run commands on the remote server | ||
| + | ==== The scripts ==== | ||
| + | == cygwin_install.cmd == | ||
| + | This is the script that does most of the heavy lifting. It's copied to and executed on the remote host. The quick rundown of what it does are as follows: | ||
| + | - Copy entire install directory to a local path | ||
| + | - Setup cygwin including the necessary packages for rsyncd and sshd | ||
| + | - Prerequisite junk | ||
| + | - Setup SSH daemon | ||
| + | - Open necessary firewall ports | ||
| + | - Copy rsyncd config files to /etc directory | ||
| + | - Start SSH daemon | ||
| + | - Create then rsyncd windows service | ||
| + | - Cleanup | ||
| - | It has the following: | + | <file DOS cygwin_install.cmd> |
| + | mkdir C:\cygwin_install | ||
| + | copy /Y \\fileserver\cygwin_install C: | ||
| - | cygrunsrv --install " | + | C: |
| + | C: | ||
| + | C: | ||
| + | C: | ||
| + | C: | ||
| + | C: | ||
| + | C: | ||
| + | netsh advfirewall firewall add rule name=SSH dir=in action=allow protocol=tcp localport=22 | ||
| + | netsh advfirewall firewall add rule name=rsyncd dir=in action=allow protocol=tcp localport=873 | ||
| + | netsh advfirewall firewall add rule name=" | ||
| + | copy C: | ||
| + | copy C: | ||
| + | net start sshd | ||
| + | setx path " | ||
| + | c: | ||
| + | net start rsyncd | ||
| - | [[wiki: | + | del /Q C: |
| + | rmdir C: | ||
| + | </ | ||
| + | == doit.cmd == | ||
| + | This is just a psexec launcher. Very straightforward and worthless: | ||
| + | <file DOS doit.cmd> | ||
| + | .\psexec.exe \\%1 -e -s -c cygwin_install.cmd | ||
| + | </ | ||
| + | So when it's time to "do it" you will just `.\doit hostname`\\ | ||
| + | == rsyncd.conf == | ||
| + | I shouldn' | ||
| + | <file ini rsyncd.conf> | ||
| + | gid = 544 | ||
| + | uid = 18 | ||
| + | use chroot = false | ||
| + | transfer logging = true | ||
| + | log format = %h %o %f %l %b | ||
| + | log file = / | ||
| + | max connections = 1 | ||
| + | pid file = / | ||
| + | lock file = / | ||
| + | |||
| + | [cDrive] | ||
| + | path = / | ||
| + | | ||
| + | auth users = backuppc | ||
| + | | ||
| + | hosts allow = backuppc_ip | ||
| + | | ||
| + | read only = true | ||
| + | list = false | ||
| + | |||
| + | [CompanyShare] | ||
| + | path = / | ||
| + | | ||
| + | auth users = backuppc | ||
| + | | ||
| + | hosts allow = backuppc_ip | ||
| + | | ||
| + | read only = true | ||
| + | list = false | ||
| + | |||
| + | | ||
| + | path = / | ||
| + | | ||
| + | auth users = backuppc | ||
| + | | ||
| + | hosts allow = backuppc_ip | ||
| + | | ||
| + | read only = true | ||
| + | list = false | ||
| + | </ | ||
| + | == rsyncd.secrets == | ||
| + | This is also required, at least it is using the rsync config specified above: | ||
| + | <file ini rsyncd.secrets> | ||
| + | # Also: make sure this file ends in a newline. | ||
| + | # username/ | ||
| + | # | ||
| + | #UUU:PPP | ||
| + | |||
| + | |||
| + | backuppc: | ||
| + | </ | ||
| + | == update.cmd == | ||
| + | This file is optional, but useful for updating your server(s) without going through the entire install process again: | ||
| + | <file DOS update.cmd> | ||
| + | .\psexec.exe \\%1 -e -s -c rsyncd_update.cmd | ||
| + | </ | ||
| + | Called like doit.cmd - add a hostname after | ||
| + | == rsyncd_update.cmd == | ||
| + | The meat and potatoes called when the helper above is used: | ||
| + | <file DOS rsyncd_update.cmd> | ||
| + | mkdir C: | ||
| + | copy /Y \\fileserver\cygwin_install C: | ||
| + | |||
| + | copy C: | ||
| + | copy C: | ||
| + | net stop rsyncd | ||
| + | net start rsyncd | ||
| + | |||
| + | del /Q C: | ||
| + | rmdir C: | ||
| + | </ | ||
| + | Yes - this is just a trimmed down version of the other command file. | ||
| + | ==== Final thoughts ==== | ||
| + | I keep a working copy of this directory on a workstation of mine to call it from. Really most of the scripts don't need to be pulled down by the remote host, basically just the cygwin setup file and the rsyncd config files. It's easiest to just keep everything together though. Alternatively, | ||
| + | ==== Related Links ==== | ||
| + | [[wiki: | ||
| + | [[wiki: | ||
wiki/cygwin_install_backuppc_rsyncd.1433269626.txt.gz · Last modified: 2018/09/27 02:30 (external edit)