bzowk

Monitoring & Auto Moving Folders / Files From Synced Folder

Recommended Posts

Hey Guys - 

 

I have a remote Linux box (Debian Squeeze) which for a couple of years have been manually transferring data from it to my local PC (Win 8.1) using FTP.  Once local, I'd then have to sort it manually.  I started using BTSync recently instead and wish I had thought to use it earlier.  It's a better solution by far - especially as I can sync music folders with my phone!

 

I've got an issue that I've run into that I need help with.  Between my remote Linux and local Windows systems, I sync a single folder which has 10 static category folders inside of it.  Based on labels and rules I've set up on the Linux end, files and folders of all types are placed into one of these 10 folders for synchronization to my local PC.  

 

What I'm Trying to Do

Once a file / folder is synced locally to my Windows box, it will be inside one of the 10 category folders.  Based on the category folder it's in, I want it moved to a different local folder where it will be amongst similar file / folder types.  The methods I've tried so far either continuously watch each category sync folder or do so at an interval.  Once they see a folder / file, it's moved to the target folder.

 

Synced Folder Structure: 

- "/home/user/Sync" - Single folder synced with BTSync on remote side

   - /home/user/Sync/Documents

   - /home/user/Sync/Complete

   - /home/user/Sync/FLAC

   - … (7 more folders)

These 10 folders stay in root of synced folder 100% of the time are are never deleted or moved

Folders / Files synced into each of the 10 folders range from a few kilobytes to multiple gigabytes.  The addition may also be a single file to a folder containing numerous files and sub-folders

 

My Issue

I've found that despite rules I set, files / folders are being moved before they finish syncing from the remote linux box.  The best luck I've had is setting rules not not move *.bts files since that's the extension until they are complete, but that doesn't work for folders.  For example, if syncing a folder which has 10 .flac files in it locally, the folder would be created first and the first file start to sync with the .bts format.  Once the first file finishes and changes to .flac, the rules move the folder to the destination thereby deleting the folder from the sync folder which finally deletes it from the source along with all other files.  As I download individual files as wel as folders, I need to find a rule / method where whatever has been added to be synced will not move until it's 100% downloaded.

 

Example of My Issue

  1. Lets say I add a folder named "Folder1" which contains a few files and sub-folders into "/home/user/Sync/Complete" on the remote side
  2. BtSync then starts to sync it locally into "D:\AppCache\Sync\Complete\Folder1"
  3. As "D:\AppCache\Sync\Complete" is monitored to move new contents, the app performing the task sees "Folder1" appear moves it immediately or (depending on how rules are set) does once a new file appears inside of it matching a filter
  4. The app moves "Folder1" immediately (or including it's single synced file depending on rules) to "D:\Complete" - The sync hasn't finished, but the monitoring app doesn't know that
  5. When the folder is moved, it's actually copying the folder to the new location and deleting it from the old one.  Therefore, BTSync thinks I've deleted the folder locally so in turn deletes the remote copy.  This results in the folder D:\Complete\Folder1" being empty plus the original being deleted on both local and remote sides

What I've Tried

So far, I've tried a few Windows apps. but no scripts yet.  At first, I tried Belvedere but found it's options seem to be too simplistic.  Next, I tried DropIt, but has similar results.  My most recent attempt was using Hygeia.  Even though it seemed to offer the most choices for rule criteria; it still wasn't enough.  I looked at one of my favorite sites - alternativeto.net - for additional software, but didn't see anything which may work better.

 

I considered setting up individual sync folders per category and syncing them locally with the target folders which the rules are to move the data to post sync, but the local folders contains tons of data which I don't want to sync.  Doing so would be impossible given my resources.  If I do this and set the local sync to Read Only, will that accomplish the task?

 

I'm using BTSync 2.x on both ends and plan to upgrade to Pro soon (still barely in 30 day trial) but definitely will if I can figure this out. 

 

Does anyone have suggestions for how to accomplish this?  Thanks!

Share this post


Link to post
Share on other sites

Use the read-only flag if you don't want the files removed from the location on the Linux box.

I use Dropit so I am most familiar with it. How are you setting up your action rules?  Because if you set your rule like this

 

Watch: D:\AppCache\Sync\Complete

Rule: *.mp3/.bts (not knowing the file types I'm just using it as an example)

Action: Move

Destination: D:\Complete\%subdir%

 

In my testing that should result in the following:

 

D:\AppCache\Sync\Complete\Folder1 with 0 files

D:\Complete\Folder1 with all files and subfolders

 

Note that I am moving the files but not the folders themselves with this rule.  The %subdir% tells Dropit to recreate the subdirectory structure.  I am also assuming that you don't have any other rules doing cleanup tasks that might be getting in way.  If so you might want to adjust them so they operate only when the folder/file Date Modified time is older than X minutes and thus giving things time to settle down.

 

Anyway hope that helps. If not I have more complicated ideas on how to make it work.

Share this post


Link to post
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.