In a recent article, we showed how to use the Linux Rsync utility to create redundant copies for your backups and recordings. If you keep your 3CX backups and archived recordings on Windows, you too can enjoy the same flexibility, by taking advantage of the “Windows Subsystem for Linux” (WSL) option. Enabling this option allows you to launch a Linux command shell, followed by the rsync utility, right from your Windows Powershell command prompt. Read on to find out how to perform this cross-platform trick.
Enable Windows Subsystem for Linux (WSL)
To use rsync on Windows, you need to enable WSL:
- On Windows 10:
- Go to “Settings” > “Apps” > “Apps & features” > “Programs and Features”.
- Click on “Turn Windows features on or off” and scroll down to enable the “Windows Subsystem for Linux” option.
- Click on “OK” and restart your PC when you are prompted.
- On Windows Server 2019, the procedure can be performed with a single command. Open a PowerShell command prompt as Administrator and:
- Run this command:
- Restart your computer when prompted, to ensure that WSL can initiate a trusted execution environment.
After restarting your Windows machine, WSL will be available to use for this purpose.
Mirror, Mirror on the Wall, Keep my Backups Safe from All
With the Windows Subsystem for Linux (WSL) now enabled on your Windows machine, you are ready to use rsync and mirror your 3CX backups and recordings. Keep in mind that you need a destination host, i.e. setup a Linux machine running the rsync service or a NAS (Network Attached Storage) device on the cheap.
Open a command prompt as Windows administrator and:
- Change to your 3CX backups or archived recordings folder, e.g.:
- Run the Linux bash shell from within your current command prompt:
- Verify that rsync is available on both machines by running rsync in test run mode (–dry-run) from your Windows host. Ensure that you have proper user permissions on both the source and destination directories:
- You will be prompted to enter the password for the user on the destination machine to test the rsync transfer. Provide the password to perform the rsync test run and verify the transfer size and related stats.
Follow the command syntax “rsync [options] [source] [destination]” as provided in the example above and note that:
- Options are chained as “–dry-run -avr”, i.e. “–dry-run” for test run, “a” for archive mode, “v” for verbose operation, “r” to recurse into the source directory.
- The source directory is on your Windows machine converted to a Linux path and mounted under “/mnt”, e.g. “/mnt/c/Users/PBXadmin/3cx_backups”.
- The destination directory, e.g. “/home/3cxrsync/redundant_backups”, is on the Linux rsync machine, e.g. ”rsyncsrv.example.com” and accessible by the specified user, e.g. “3cxrsync”. If you need to create a directory on the Linux host, use the “mkdir” command, e.g. “mkdir backups”.
- Note that rsync transfers can be configured with a multitude of options, e.g. “-o” and “-g” preserve the owner and group permissions on the transferred files. Adding “z” implies compression during transfer, while “–progress” provides status updates during the file transfer. You can study all the rsync options in detail by running:
Mirroring Your 3CX Data from Windows to Linux
After verifying that rsync works on both machines, you can proceed to mirror your 3CX data. Structure the rsync command in your case based on this example:
rsync -navzhr /mnt/c/Users/PBXadmin/3cx_backups firstname.lastname@example.org:/home/3cxrsync/redundant_backups
Make sure you update all paths, user and host specs to fit your network environment parameters. When you finish transferring your 3CX backups, you can repeat the command for your archived recordings, updating the source and destination for the transfer as required.
Congratulations! You can now keep your 3CX PBX safe with rsync, mirroring backups and archived recordings from Windows to Linux.
Did you know that we have just updated all our comparison sections?
There’s no better way to make an educated decision than to compare offers first!
Alternatively >>>Leave your detail<<< and have a few providers contact you!
**PS. If you are a Telecoms Reseller in South Africa be sure to check out Telecoms-Channel which is specifically designed to provide you with content, insight and analysis to establish yourself as an authority in the industry.**