# Using Sync Agent to sync a folder outside odrive folder?

**URL:** <https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672>\
**Category:** Troubleshooting\
**Tags:** agent\
**Created:** [January 23, 2018, 11:59am UTC](https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672 "2018-01-23T11:59:42Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![bouya.daman](https://forum.odrive.com/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@bouya.daman](https://forum.odrive.com/u/bouya.daman)\
**Post date:** [February 8, 2018, 2:35pm UTC](https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672/21 "2018-02-08T14:35:01Z")

</div>

In reference to your statement:  
“  
A refresh on the folder containing any local changes that you want to send to the cloud should trigger an immediate scan for odrive in that location (unless odrive is busy doing something else in another location), which should then send any “dirty” files to the remote storage.  
”

Does this mean refresh can be used to delete files from a remote? or are “changed” files only files that exist and are modified? but I can’t sync a directory then sync all the files in it, then move those files away leaving the directory empty and then refresh that folder manually to delete it from the cloud? (I’d actually want this to happen, but it doubt it works this way? I assume refresh works about the same as killing the agent and restarting odrive? or rebooting and restarting odrive right?) not this alternate bizarre function I just made up? (I’ve never run a refresh command manually, and given what I just said, I’m slightly afraid to).

---

<div class="post-metadata">

**Author:** ![Tony](https://forum.odrive.com/user_avatar/forum.odrive.com/tony/32/19_2.png) [@Tony](https://forum.odrive.com/u/Tony)\
**Post date:** [February 8, 2018, 3:38pm UTC](https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672/22 "2018-02-08T15:38:03Z")

</div>

Hi @D_Sec,

> [@D\_Sec](#):
>
> Just maybe one last question, as now odriveagent will be running all the time in background.
> 
> Is there any other way than unmount to pause replication during the day?

I didn’t see your edit here. You can use the `shutdown` command to stop the agent, and then launch the agent again when you want to resume. Is that what you are looking for?

---

<div class="post-metadata">

**Author:** ![Tony](https://forum.odrive.com/user_avatar/forum.odrive.com/tony/32/19_2.png) [@Tony](https://forum.odrive.com/u/Tony)\
**Post date:** [February 8, 2018, 3:41pm UTC](https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672/23 "2018-02-08T15:41:15Z")

</div>

Hi @bouya.daman,  
A refresh is really just a manual way to tell odrive to look at the current folder and make sure the sync engine is up-to-date. For some integrations and configs odrive cannot see change events, so a change will not be picked up until odrive gets around to doing its periodic walk-and-check. A refresh will shortcut this on the target folder.

Deletes will be picked up in this case, and any local files that have been deleted in that folder will be picked-up and those delete actions will be held in the odrive trash until the user empties the odrive trash, which will sync those deletes to the remote storage.

---

<div class="post-metadata">

**Author:** ![bouya.daman](https://forum.odrive.com/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@bouya.daman](https://forum.odrive.com/u/bouya.daman)\
**Post date:** [February 8, 2018, 4:06pm UTC](https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672/24 "2018-02-08T16:06:38Z")

</div>

This probably renders dozens of other questions I also just wrote irrelevant.  
So I can simply delete a regular file (that odrive previously sync’d) then refresh the folder and then “empty trash” and then the file will be deleted from ACD as well?

That’s exactly how I wanted things to work. If true you can ignore all the other silly questions I wrote over at

> [@Reset my odrive install and getting "This file does not exist" messages anytime I try to sync anything](https://forum.odrive.com/t/reset-my-odrive-install-and-getting-this-file-does-not-exist-messages-anytime-i-try-to-sync-anything/3785/8):
>
> Hmm, now that I see that odrive will automatically replace any missing .cloudf or .cloud files within the sync folder. How do I disable this? Leave odrive on, but have this feature off? When I look at status I see: odrive Make Cloud Storage THE WAY IT SHOULD BE. isActivated: True hasSession: True email: accountType: Google syncEnabled: True version: prod 924 placeholderThreshold: neverDow…

---

<div class="post-metadata">

**Author:** ![Tony](https://forum.odrive.com/user_avatar/forum.odrive.com/tony/32/19_2.png) [@Tony](https://forum.odrive.com/u/Tony)\
**Post date:** [February 8, 2018, 4:41pm UTC](https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672/25 "2018-02-08T16:41:15Z")

</div>

Hi @bouya.daman,

> [@bouya.daman](#):
>
> So I can simply delete a regular file (that odrive previously sync’d) then refresh the folder and then “empty trash” and then the file will be deleted from ACD as well?

That is correct. 🙂  
After it sees the delete, the sync engine will hold on listing the delete in the trash queue for about 30 seconds, so just keep that in mind.

---

<div class="post-metadata">

**Author:** ![bouya.daman](https://forum.odrive.com/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@bouya.daman](https://forum.odrive.com/u/bouya.daman)\
**Post date:** [February 9, 2018, 11:13am UTC](https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672/26 "2018-02-09T11:13:01Z")

</div>

Didn’t even have to refresh, odrive was very quick about picking up on deleted files.  
One comment though the emptytrash command could use feedback, my trash had/has 40,000 items in it, and I run emptytrash command and I see nothing, if I did something similar with sync I’d be getting spammed by lots of line by line information (which would assure me it was working).

Yes I can see the trash number shrinking by using the status command, but these 40,000 deletes might take all day so it would be nice if each delete triggered feedback in the command line. The deletes are going slow enough that next time I delete a migrated folder I might just delete files larger than 1MB, and let ACD remain polluted with a million tiny tiny files. heh.

edit: I wonder, it might just be faster to issue the delete command via ACD’s website, I think the reason odrive is deleting 40,000 files so slowly is throttling by ACD in regardless to api access

---

<div class="post-metadata">

**Author:** ![Tony](https://forum.odrive.com/user_avatar/forum.odrive.com/tony/32/19_2.png) [@Tony](https://forum.odrive.com/u/Tony)\
**Post date:** [February 9, 2018, 5:43pm UTC](https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672/27 "2018-02-09T17:43:48Z")

</div>

Hi @bouya.daman,  
I agree, some feedback would be nice.

> [@bouya.daman](#):
>
> I wonder, it might just be faster to issue the delete command via ACD’s website

The odrive trash is a safety mechanism which prevent unintended deletes from hitting the remote storage, so Amazon doesn’t even know about the deletes until odrive sends them. That means that it has to be odrive that does it and there isn’t really a way to shortcut it… Once you clear the current queue it will at least be faster as you in-line the empty command.

---

<div class="post-metadata">

**Author:** ![bouya.daman](https://forum.odrive.com/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@bouya.daman](https://forum.odrive.com/u/bouya.daman)\
**Post date:** [February 10, 2018, 7:34am UTC](https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672/28 "2018-02-10T07:34:29Z")

</div>

What do you mean by inline the empty command? (also btw yes, the emptytrash command finished correctly eventually),

---

<div class="post-metadata">

**Author:** ![Tony](https://forum.odrive.com/user_avatar/forum.odrive.com/tony/32/19_2.png) [@Tony](https://forum.odrive.com/u/Tony)\
**Post date:** [February 10, 2018, 4:48pm UTC](https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672/29 "2018-02-10T16:48:50Z")

</div>

Hi @bouya.daman,  
I just meant adding the emptytrash command the trash as part of the overall script flow, so it is happening frequently as things are deleted.

[Previous page](https://forum.odrive.com/t/using-sync-agent-to-sync-a-folder-outside-odrive-folder/3672.md?page=1)
