tbenz9 / siasync

miniscule utility to sync a folder with Sia
MIT License
67 stars 10 forks source link

Siasync from Network drive stops at "xx contracts are ready for upload" #3

Closed sheggy012 closed 5 years ago

sheggy012 commented 5 years ago

Hello everybody, I just discovered this tool and wanted to test how well I can backup my NAS directories. Now I have the problem that the upload doesn't start. The last message is "60 contracts are ready for upload". My command is Siasync-windows-amd64.exe -debug -archive true -subfolder "foo\bar" "Z:\foo\bar". I see that the application is trying to read from the network drive with 1gbit, since about 10 minutes. What's happening in the background? Why doesn't the upload start?

sheggy012 commented 5 years ago

When looking at the code it looks like a checksum is formed for each file. This takes a long time for many large files. Is it possible to check only for the file name, this is unique in my case?

tbenz9 commented 5 years ago

@sheggy012 I'll try to answer your questions.

What's happening in the background?

Most likely your files are uploading to Sia, even if it's not printing output. Siasync is meant to run for long periods of time so I wanted to minimize the output of the program. You can check if the files are uploading in the Sia-UI or by running siac renter ls /foo/bar. As files are added, removed or modified in the foo/bar directory then Siasync will give additional output.

Why doesn't the upload start?

It probably did start, it doesn't output anything when it starts to upload.

Is it possible to check only for the file name instead of the checksum

Not at this time and that's a bit risky so I probably won't be adding it unless more people ask for it.

If you need more help feel free to comment below or reach out to me on the Sia Discord.

sheggy012 commented 5 years ago

If it wouldn't be much trouble, I'd appreciate it if you could add the function to upload already existing files. Not only everything that is newly created. Of course you can realize this from Sia itself but there is no file filter (by type) in Sia.

tbenz9 commented 5 years ago

It does that already. When Siasync runs it does 2 things. 1: Uploads everything in the folder to Sia (this happens in the background and does not print out anything) 2: Continues to monitor the folder for changes, and applies any changes to Sia as they are detected (like new files, deleted files, or modified files).

Can you open Sia-UI and see if your files are being uploaded?

sheggy012 commented 5 years ago

It looks like no files are found. Although it detects them when adding them to the folder, it aborts with the error message "The system cannot find the specified path. Here is an example : C:\Users###\Desktop>Siasync-windows-amd64.exe -archive -debug -include mkv -subfolder "foo\bar" "Z:\foo\bar" 2019/07/08 08:44:41 Connected to Sia 1.4.1 2019/07/08 08:44:41 58 contracts are ready for upload 2019/07/08 08:44:42 watching for changes to Z:\foo\bar Found extension in include flag 2019/07/08 08:44:47 file creation detected, uploading Z:\foo\bar\test.mkv 2019/07/08 08:44:57 error uploading Z:\foo\bar\test.mkv: upload failed: [unable to stat input file; CreateFile Z:\foo\bar\test.mkv: Das System kann den angegebenen Pfad nicht finden.]

Is that because of the network drive?

sheggy012 commented 5 years ago

tried it again from a local drive. Local drives are working as expected

sheggy012 commented 5 years ago

Okay found the Problem. Siac is not able to work with Network Drives, it has nothing to do with you tool. Changed "Z:\foo\bar\test.mkv" to \NAS\foo\bar\test.mkv and now its working perfectly.