This is a script that performs Rsync backups from Windows to Unix servers. It sports the following advanced features:
- It creates volume shadow copies for consistent backups and backups of open files.
- It sends email notifications when a backup fails and on every 10th backup so you know it is still working. These email notifications contain the error messages and the transfer stats.
- It includes an XML file that can be imported into Windows' Scheduled Tasks.
- Windows Vista and higher (tested on Windows 7 Professional and Windows 10 Pro)
- Clone this repository to C:\Program Files (x86)\rsyncbackup.
- Open a
cmdprompt with Administrator privileges.
powershell.exe -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
powershell.exe -File "C:\Program Files (x86)\rsyncbackup\rsyncbackup.ps1"
- It will show you a link from where you need to download cwRsync. Extract the ZIP file and place its contents into C:\Program Files (x86)\rsyncbackup\cwRsync.
powershell.exe -File "C:\Program Files (x86)\rsyncbackup\rsyncbackup.ps1"again to generate the SSH key and do an initial backup.
- Open the Windows Task Scheduler (
taskschd.msc) with administrator privileges and import the XML file. The backup will then run at noon on weekdays and 6pm on weekends.
Backed-up files are logged to C:\Program Files (x86)\rsyncbackup\rsyncbackup.log. Errors are logged to C:\Program Files (x86)\rsyncbackup\rsyncbackup_err.log.
ASLR exception needed on Windows 10
rsync (and other Cygwin binaries that call
fork()) have trouble with Windows 10's latest ASLR enhancements.
If you see error messages like these in rsyncbackup_err.log
fatal error - cygheap base mismatch detected fatal error in forked process - fork: can't reserve memory for parent stack
then you need to add an ASLR exception:
- Go to the Start menu and search for and open Windows Defender Security Center.
- Select App & browser control.
- Select Settings for Exploit Protection.
- Go to the Program settings tab.
- Add a new program by full path for both rsync.exe and ssh.exe in C:\Programme (x86)\rsyncbackup\cwRsync.
- Check both ASLR options and set them to Off for both executables.