Before posting, and to avoid disappointment, please read the following:

  • This forum is not for 2BrightSparks to provide technical support. It's primarily for users to help other users. Do not expect 2BrightSparks to answer any question posted to this forum.
  • If you find a bug in any of our software, please submit a support ticket. It does not matter if you are using our freeware, a beta version or you haven't yet purchased the software. We want to know about any and all bugs so we can fix them as soon as possible. We usually need more information and details from you to reproduce bugs and that is better done via a support ticket and not this forum.

Local vs Remote Network Detection

SyncBackFree is the freeware version of SyncBack. It is *not* an evaluation version of SyncBackPro/SE.
Post Reply
TXShooter
Newbie
Newbie
Posts: 1
Joined: Sun Sep 18, 2016 12:29 am

Local vs Remote Network Detection

Post by TXShooter »

I travel for work, often times for weeks at a time. And then there are times when I'm working from home for weeks at a time. Life gets interesting sometimes.

Is there any way to switch profiles depending on external IP addresses? Have SBF test the external IP address and if it is determined to be 'home', then use All Normal LAN Profiles, elseif 'remote' then use limited and less secure FTP Profiles instead? Some of the data that I sync is financial... don't want that getting out there on the open interwebs.

I was out of town the other day and an SBF profile encountered a Network Failure... well, I wasn't on my normal LAN, so that makes sense. I didn't catch it until a few days later.

Thanks
Conrad Chung
2BrightSparks Staff
2BrightSparks Staff
Posts: 152
Joined: Thu Dec 05, 2013 3:01 pm

Re: Local vs Remote Network Detection

Post by Conrad Chung »

Hi, not possible with SyncBackFree.

In SyncBackPro, there is a VB script called IsHomeNetwork.vbs which may satisfy your requirements. Check this link for more info:

http://www.2brightsparks.com/bb/viewtop ... omeNetwork

Please note that we don't provide bespoke services/assistance to write/support scripts as this is beyond the scope of our support.

Thank you for your understanding.
Conrad Chung
2BrightSparks Staff
2BrightSparks Staff
Posts: 152
Joined: Thu Dec 05, 2013 3:01 pm

Re: Local vs Remote Network Detection

Post by Conrad Chung »

Hi, further to my reply, I had a discussion with my team and it seems I was mistaken. Certain scripts (like the IsHomeNetwork.vbs) is a callable script and not an installable script. Hence, such (callable) scripts will work on SyncBackFree and SyncBackSE as well (including SyncBackPro). Please disregard what I wrote in my previous post.

Please note that this script is not included in SyncBackFree, but I can send you a copy here. You can download the VBS script in the attachment link below. File is zipped, so be sure to unzip it before use.
IsHomeNetwork.zip
(985 Bytes) Downloaded 448 times
How to use IsHomeNetwork.vbs script

The vbs file contains further instructions on how to use script properly. You can open the file in Notepad to view them.

To avoid running a profile when connected to a certain network, you need to call the script file under Modify>Program-Before section (of the profile).

You will also need to create a config DHCP.TXT file (with the DHCP address at home) as input for this script file to run (please refer to the script file for more information). The return value of the script is either 0(if the code finds the DHCP address given in the config file) or 1(otherwise).

You can configure this as:
Modify > Expert > Program-Before > enable 'Run before Profile' and configure the path to the program folder where IsHomeNetwork.vbs is installed.

You should enable the options 'Wait until the program has finished before running profile', 'Abort the profile if the program fails to execute' and 'Abort the profile if the programs return value is not'.

If you do not want to run the profile when you're not connected to your home network then you have to set the 'Abort the profile if the programs return value is not' to [1] or otherwise you have set it to 0.

The above was provided as an example, but you can adapt script to suit your requirement(with your preferred return values). Similarly, you can do the same for the other FTP profiles (but you probably need to tweak the script to suit your situation).

Please note that we don't provide bespoke support/assistance to write customized scripts for users. We provide the example scripts provided in the SyncBackPro program folder. The rest is up to the user.
inode
Newbie
Newbie
Posts: 4
Joined: Sat Sep 22, 2018 8:21 am

Re: Local vs Remote Network Detection

Post by inode »

I have created a little powershell script to do the same thing as the vbs but it check the network profile name.

Just set this command into "Run before profile" and abort in case the script return 1.

Code: Select all

powershell "$desired_network = \"WIFI PROFILE\"; $a = Get-NetAdapter | Get-NetConnectionProfile; If ( $a.Name -eq $desired_network ){ exit 1} Else{ exit 0 }"
To get the current profile name just run

Code: Select all

powershell "Get-NetAdapter | Get-NetConnectionProfile"
inode
Post Reply