realtime sync on linux mint over a samba folder

Get help for specific problems
Posts: 5
Joined: 10 Jan 2025

imotep33

hello, i'm using freefileSync on Windows since almost 10 years. i'm running realtimeSync on windows with batch files for automatic launch on startup. everything works fine.

I'm now trying to move to linux Mint. and i'm a bit lost...
If I want to transpose my windows configuration to Linux, I guess I need to:
- Manage an automatic mount of my smb folders on startup,
- Open my FFS file in linux,
- Create a RealtimeSync task
- Manage an Autolaunch of the realtimeSync task on startup.

Am I right?
If yes, where can I gather simple information for this? I'm trying to do the automatic mounting, but it's already quite tricky for me...

Thanks for your help
Posts: 6
Joined: 4 Jan 2025

Tidy

Hi,

for mount to be able to deal with smb shares you need to install the cifs-utils package (sudo apt install cifs-utils).
To automatically mount your smb folders, you can add them to your fstab, or you can use autofs. With autofs they will be mounted when accessed, and unmounted after some idle time, with fstab they will be mounted continuously. I can give you my autofs config for my NAS as a reference to help to get you going with autofs.
I have never used realtimeSync so I can't comment on that. I also don't know how well realtimeSync will work together with autofs, maybe the fstab route makes more sense in this case.

Best regards!
Posts: 5
Joined: 10 Jan 2025

imotep33

thanks for the advice.
I struggleled a little bit to mount properly, but at the end i also used Fstab with the following lines:
//MYMACHINE.local/SHAREDFOLDER /home/USER/MOUNTNAME cifs _netdev,credentials=/root/.smbcredentials,file_mode=0777,dir_mode=0777

Of course, i made a .smbcredentials file in the root folder.
I had to use the file an dir modes "0777" to have the Read and Wright rights
So far, FFS works. I still need to figure out how I'm going to make realtimeSync to launch on startup...
Posts: 1
Joined: 11 Jan 2025

JlMbo

Hi
Not sure about Linux Mint, but in Ubuntu 24.04 there is 'startup'.
I click on 'Activities' in the top LH corner, type 'startup' and click 'add' in the startup window.
You can add programmes there including your RealTimeSync batch file.
I am sure experienced linux user know of many ways but that is where I launch mine.
:-)
Posts: 5
Joined: 10 Jan 2025

imotep33

Hello, just a quick update:

I checked if the trash bin is working on both sides.
On My computer I needed to configure my local drive to "automount on startup" via the disk utilities. and i also added ",uid=1000," on my local drive parameter in the Fstab file in the new line the disk utilitie added. Now FFSync can send the file in the right trash bin.
On my Nas, it kind of fine in the first place. FFS says it can't send the file to the bin, so I clicked "Ignore this message". now when it tries to send file to the bin on te NAS, it is not able to do it, but instead it does a permanent file removal. Which the Nas interprets by "sending file to the bin".
The main risk for me, is to have so issues with my local drive bin. I won't have the error message anymore and instead of running "bin deletion" on one side and "permanent deletion" on the second side, I could go to a both "permanent deletion" on both side without knowing it.

=> For the developer, a good evolution could be to add the choice of how to delete the file on each side. like you can choose: to the bin on one side, and permanent delete on the other side.

As I'm running Linux Mint, i also needed to change the app file path in the RealTimeSync batch command line.
Basically RTS wants to run: /usr/FreeFileSync "/BATCH FILE LOCATION"
On Linux mint, the path has to be: /usr/bin/FreeFileSync "/BATCH FILE LOCATION"

I'm now trying to get everything to work automatically on startup.
I'm also experiencing some time the "exit on error code 1" issue described in this topic.
viewtopic.php?t=7189 i'll tell you if I managed to get out of this.
Posts: 5
Joined: 10 Jan 2025

imotep33

I have apparently one last issue to solve when I sync 2 folders.
when the file is sent to my Nas server, the date changes. Lets say I modified the file a 01:00 and I synchronized ad 02:00, I then have the same file but with the last modification date at 01:00 on the first side and 02:00 on the other side.
it creates then conflicts because it syncs from side 1 (01:00) to side 2 (02:00), and then the next comparison it is going to sync from side 2 (02:00) in order to override the side 1 with the same file but with the new date set at 02:00

I guess I'll have to look at my mounting options to allow keeping the orginal date.
Posts: 5
Joined: 10 Jan 2025

imotep33

I finally found my way by using an extra "uid=1000" to my Fstab config. It now seems to work Ok and keep the modification dates on both sides.
But now it behave differently with the trash-bin. by doing this, the file is deleted by FFS to the .trash-1000 folder on my NAS instead of a "permanent" delete. and if I delete it from my trash folder on Linux it gets permanently deleted on the NAS without going to the Nas bin. so it's a kind of compromise between the old and the new solution.

As I said, it would be great to chose the type of deletion on each side. I would still prefer to have a "delete to the bin" on one side and a "Permanent delete" on the other side.