Btsync On Raspberry Pi / Nas Randomly Deleted Files


Stingly

Recommended Posts

I have BTSync set up on my Raspberry Pi to sync files from my Buffalo LS421DE NAS. I then have the Android app installed on my phone and tablet and the wife's phone and tablet.

 

The idea was to automatically back up photos and videos from our mobile devices, directly to the NAS box at home, which seems to work OK. We then extended our use to allow BTSync access to all of our files on the NAS, including all digital photos of our children since their births. This meant that we could look at any file at any time from any device, and this was good.

 

Last night I made a chilling discovery - something had deleted all of our photos and videos (and a lot of other documents) from the NAS! After lots of routing around, I found that it was BTSync that was to blame. I know this because I found a backup of most of the files in the .SyncArchive folders (which I am thankful for!).

 

My question is this: why were they deleted!??!

 

I have spent the last 18 hours restoring all of my files, and have just turned the Raspberry Pi off until I can get to the bottom of this. There is just no way that I can continue to use BTSync if this is ever likely to happen again - what would have happened if it didn't back them up on delete... or if it decided to empty its backup folder... its just a risk that I am not willing to take, which is a shame because, for a while, everything was working so smoothly...

Link to comment
Share on other sites

My question is this: why were they deleted!??!

Have you verified that they system clocks on your devices are in sync and correct?

 

what would have happened if it didn't back them up on delete...

...but it does! Sync "moves" deleted files on other devices into a hidden SyncArchive folder on your device rather than delete them outright.

 

or if it decided to empty its backup folder...

This is controlled by the "sync_trash_ttl" setting - Set this to "0" and Sync will never delete stuff from SyncArchive

 

its just a risk that I am not willing to take...

Please do bear in mind that Sync is currently "beta" software, and should be regarded as such.

Link to comment
Share on other sites

  • 2 months later...

Thanks for the reply. After further deliberation I think that the problem was caused by the connection between the pi and the NAS. I think that the NAS went to sleep, the pi checked the NAS and determined there to be no files and then when the NAS woke up, proceeded to delete them!

To be honest it's all a bit of a guess... I've since decided to give btsync another chance. Like you say, it's a beta. So this time I've attached a USB hard drive to the pi and am using a cronned rsync to copy the folders I want to share from the NAS to the USB drive. I'll then set up btsync to share the USB, and not the NAS. From extensive reading, this seems to be a fairly robust configuration, so I hopefully won't lose anything this time!

Thanks for the suggestion of sync_trash_ttl - I may have to use that... I think though that my set up should allow for problems and btsync deleting things as rsync will just reinstate any deleted files when it runs. The only way to actually delete anything will be to bin them on the NAS and run rsync manually with the delete flag enabled.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.