In the synchronization directory of syncthing, I found some .syncthing.**.*.tmp files, as shown in the figure. I want to know if syncthing will automatically delete these files? From what I can see, 1 hour has passed and the system has not processed it. In addition, the status of syncthing is a successful synchronization status, so I want to know whether the system will automatically delete it in the future. If it cannot be automatically deleted, what methods should I use to deal with these temporary files?
Those files should disappear/be renamed evenutally so that the local structure is the same as the remote one.
That being said, 1h would appear to a a long time for this to happen (then again, the files seem to somewhat large, so it might be worthwhile checking the GUI in your browser and posting a screenshot of that)
And… it might be just my impression, but I see a lot of questions and reports about this phenomenon recently, which could point to a bug in a recent version, but it could also just mean that a certain type of configuration has become more common recently - what kind of system is this? Are we looking at the files on a standard Windows machine, or is this some sort of network share, possibly running on linux and in a container?
They will be deleted after 24 hours. This is configurable (see https://docs.syncthing.net/users/config.html#config-option-options.keeptemporariesh).
Better question is why they’re there to begin with, which is because the sync failed to either pull data or do the final cleanup/rename. Those sync failures would be something to look at, and then the temp files will be resolved into their actual destinations.
yeah,it’s windows system run sftp software browser some share files.
syncthing install in the centos system. syncthing roaming folder in the USB External Hard Drive roaming files size about 60GB
thanks a lot your remind.I can see a about keepTemporariesH option in the config.xml
OK, so syncthing is running on a linux machine, and has been installed using centOS package manager (yum or dnf)?
A screenshot of the GUI in the browser showing the failures might help, but it is most likely a permission issue of that folder.
The folder is on an external drive → what is the filesystem of that drive?
OK,I understand.
I actually want to know.
Will the system automatically clean up whese tmp files?
if not yet.then manual delete tmp files is it feasible?
According to the above statement,It can be automatically cleaned within 24 hours. If so, then I will be relieved.
- After downloading the syncthing file from the official website, unzip it and place it in the directory, then configure the service and config startup parameters and run it directly. The approximate parameters are as follows:
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=man:syncthing(1)
After=network.target
StartLimitIntervalSec=60
StartLimitBurst=4
[Service]
User=nobody
Group=nobody
Environment=STNORESTART=1
ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0 --no-default-folder --home=/usr/local/opt/syncthing/config/
Restart=on-failure
RestartSec=1
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
# Allow access to the configuration directory
ReadWritePaths=/usr/local/opt/syncthing/config/
# Hardening
ProtectSystem=strict # More relaxed than full
PrivateTmp=true
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
-
In the GUI interface, no synchronization error was found, indicating a successful synchronization
-
The synchronized folder is a directory related to the mobile hard disk. The file permission is 777 for nobody. Here is a special note: My mobile hard disk is an ntfs partition, which is then mounted and used through the ntfs-3g plug-in. At present, it is still good in actual use
They will be deleted after 24 hours, although this also depends on your folder rescan interval, because that is when the cleaning process happens. If you have a very long interval set, then it may take longer than 24 hours.
The question is really whether the temporary files are something you expect or not. For instance, I sync a lot of files that are processed by other software, so oftentimes they also get deleted while in transfer, which leaves temporary files on other devices that haven’t finished downloading yet. In my cases, this is completely normal and I don’t worry about them. They do get deleted automatically by Syncthing when it rescans the folder later on.
On the other hand, if you expect transfers to finish and they don’t, being stuck in the temporary form, then this indicates some kind of a problem (e.g. permission issues, etc.).
o yeah~ I just check the folder,the *.tmp file is delete.
thank you very much
I have learned a lot recently.
This is good to know. I have a lot of .tmp files but they have been around for longer than 24h I am sure. I am in the process of writing a script to remove them. They also contain “.sync-conflict-” in the file name.
They are only removed when the folder is scanned, so it may take more than 24 hours under some circumstances, e.g. if the folder’s scan interval is set to something longer than that (with the default scan interval being 1h).
Conflicts are a completely different story though. Please see https://docs.syncthing.net/users/syncing.html#conflicting-changes for details.
Also, they typically exist for a reason - a file failed to sync. You can remove the temp file but it will be recreated next time it tries to sync that file.
I understand what the “sync-conflict” files are for and why they should happen. However the thing is in my case is that the sync-conflict files should not be conflict’s, they are the same file size.
I just ran a script and I had 118 “sync-conflict” files (445 GB) that matched the file size of their counterparts of one of my systems. These are files that I don’t want or need to be duplicated and are using up unnecessary storage space.
I have rescan interval set to 24h.
The contents may differ though the size is the same. Conflicts can also be disabled on a per-folder basis…
These files have been the same on all systems for 1+ years. They are static media files. I don’t see why I should still have “sync-conflict” files in my Syncthing folders.
However you are correct, the contents is different. I have checked a file and its sync-conflict file and the MD5 hash’s of the file are different. They are media files, and I expect they should be the same file on all systems.
Example:
- File “S05E06.XviD-AFG.avi”
- MD5 50abfc6c963f215e4ec1fa7b21506c4c
- File “S05E06.XviD-AFG.sync-conflict-20250407-070137-MD3TD5P.avi”
- MD5 6e44ca31627c6dceceaeaa26c4c4cc83
- File “S05E06.XviD-AFG.sync-conflict-20250407-193441-MD3TD5P.avi”
- MD5 6e44ca31627c6dceceaeaa26c4c4cc83
Why do you think this may of happened? One of the systems is causing some corruption?
For media files my first guess would be some indexing system writing metadata to the files.
The media files are untouched by any indexing system or external software.
I am 99% sure it was because the system had one faulty stick of RAM which I have now removed.