banner
miaoer

miaoer

喵二の小博客 xLog 分站
tg_channel
telegram

A user-friendly SMB backup software FolderSync

Video address:


Start#

Recently, I discovered a very good SMB backup software called FolderSync. Earlier, I used to back up the photo directory by connecting my computer with a data cable.

Because my family doesn't have a branded NAS due to financial constraints, I set up a SAMBA service on my software router to store movies and shared resources, etc...

Let's explore it today.

image

We can download this software from the Google Play Store. I have also prepared an APK package for easy download.

Lanzou Cloud Password: 5cgt

Because the software requires payment, if you have the ability, you can download the free version from the Play Store. The version on Lanzou Cloud is a green version, and I don't know if there are any security risks.


After downloading, open the software. You will see that we need to grant permissions for it to work properly. I recommend opening all the suggested options here.

Since the settings for the system UI may be different, follow the instructions in the software one by one.

In the software, go to the bottom bar and find "Accounts". Click on "Add Account". You will see many types of accounts, but these are not the focus.

Scroll to the bottom and you will see SMB2. Why not choose SMB1? Based on my testing, SMB1 doesn't work no matter how it is configured. If SMB2 doesn't work for you either, you can allow ports 445 and 139 in the firewall.

I use the Baota Linux panel to allow ports.

image

Firewall Allowance#

In the terminal, enter sudo apt-get install iptables-persistent,

During installation, you will be asked whether to add IPv4 and IPv6 rules. Choose "Yes" for both.

After the installation is complete, enter the following command:

iptables -I INPUT -p tcp --dport 445 -j ACCEPT && iptables -I INPUT -p tcp --dport 139 -j ACCEPT

Enter sudo netfilter-persistent save to save the changes.

This way, the ports are successfully allowed.

Security issue: If you are on an external network, you need to forward the ports to the public network. If you haven't dealt with external network services, you can simply turn off the firewall. I don't recommend opening the SMB port to the public network as it is prone to attacks. You can use the reverse proxy plugin in OpenWrt to do reverse proxy. I may explain this in a separate article later. It's really simple. I won't keep you in suspense here; just find a domain name for DDNS, open the ports and forward them, and enable reverse proxy. Remember to enable "Accept LAN access" and set up a global proxy in the mobile app. Then you can access the internal network service from the external network, as long as you haven't opened too many proxy passwords and ports, it's safe.

Setting up SAMBA Service#

If you haven't set up the SAMBA service, here's a brief explanation.

Here, the user is named "miaoer" and the share is named "nas". Please replace them with your preferred format.

useradd miaoer     //Create a new username "miaoer"

sudo apt-get install samba     //Install samba with administrator privileges

sudo smbpasswd -a miaoer     //Set the samba username and password for "miaoer"

cd / && mkdir nas     //Create the "nas" shared folder in the root directory

chmod 777 nas     //Grant 777 permission to the folder

You can find a way to edit the configuration file and upload it, or use the vim command. Press i to edit, press Esc, then Shift + : until you enter :wq to exit.

[nas]
        comment = nas
        path = /nas
        browseable = yes
        writable = yes
        file mode = 660     
        force file mode = 660
        directory mode = 770
        force directory mode = 770

Software Settings#

Okay, let's get back to the topic. In the SMB2 settings, enter the username and password you just set in the login section.

In the connection section, enter the host address where the SAMBA is deployed in the internal network, and leave the port number as default. Enter the folder name you just set as the shared name.

Then click on save.

Next, go to the "Folder Pairs" on the left side of the screen and create a folder pair. Choose SMB2.

You will see many options here.

For the sync type, I only need to select "To remote folder".

Click on the remote folder. Since there is no dedicated folder for backup here, create one. I set it as the "Mi10" folder, but you can choose any name you like.

After creating the folder, click on it and check the box in the lower right corner.

For the local folder, the photos are in the "DCIM" folder. Click on it and check the box. You can test it first.

Original Images#

Now we have no problems. Go back to the homepage. We still can't click on the sync button yet. We need to do a few more steps. First, open the settings and go to the cloud service. In the album section, select "Download Original Images" automatically.

Click on "Sync Now" to sync the album immediately. Then go back and enable "Fast Sync". This way, downloading the original images will be faster.

Okay, I ran it for a while and finally pulled back the album from the cloud service. Let's continue.

Click on "Sync" and go back to the homepage of the app to check the sync status. If it's running, it means it's working fine. Next, let's set up a scheduled task. Set the task according to your personal preferences. I set a custom time, which is my bedtime for backup.

image

However, make sure that FolderSync has the permission to start automatically and that power-saving strategies are disabled. Otherwise, the previous settings will be in vain.

This article is synchronized and updated to xLog by Mix Space.
The original link is https://www.miaoer.xyz/posts/blog/app-foldersync


Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.