Have a setting that removes local files after syncing them to the cloud


I’m testing insync before purchase on Ubuntu 20.04 LTS, for a Google Drive.

What I’m trying to do is pretty simple, locally I have

        ┣━━━━━━━ 2-way-sync-dir / files...
        ┗━━━━━━━ 1-way-sync-dir / files...

(the GD-base-dir has 2 dirs, one for 2-way sync and another one for 1-way)

The 2-way-sync dir seems to be working

  • local files are copied remotely, and remote files are copied locally
  • removing a file on either side remove it on the other side

But to make the 1-way-sync dir being “1 way”, I’m not sure what to do.
I clicked “Unsync” (as it’s the only option relevant available), then

  • the 1-way-sync dir appears on the drive and in insync…
  • but it disappeared from my local drive, which is probably how it supposed to work?

So to copy backups and stuff that only need to remain Google side,

  • the 1-way-sync dir must actually be 2-way (for it to remain at least locally)
  • then I copy the 1-way stuff into the 1-way-sync dir
  • and all files in 1-way-sync dir have to be “Unsynced” to be 1-way

Exemple: the 1-way-sync dir is set 2-way ; then I copy

  • backup1.tar.gz, backup2.tar.gz, … backupN.tar.gz, into the 1-way-sync dir
  • then I would have to mark (manually) all of the 1-way-sync dir content as “Unsync” to have get them on Google side (and not locally anymore)

Is that correct?

In that case, that could work, but since I’d like to automatize the process (backup, 1-way …) in a bash script, the questions are (if the above is correct)

  • is there a way to mark (Unsync) the 1-way-sync dir files from the command-line? (like insync unsync /home/me/google-drive/1-way-sync/*)?

  • otherwise, is there a way to tell insync that 1-way-sync is a dir which content is to be 1-wayed, but not the dir itself (or it disappears locally, and the process cannot be automatized)?


Hi @a.k.a :slight_smile:

Here’s how unsyncing works: https://help.insynchq.com/en/articles/3435257-unsyncing-your-files

  • It will remove the local copy if the directory was synced from cloud-to-local (“Unsyncing items from your Base Folder”)

And here’s how 1-way works: https://help.insynchq.com/en/articles/5219937-1-way-sync

To clarify: what’s the goal here - are you only looking to keep files in the cloud? Because if you set the 1-way sync dir as 2-way, you will indeed have a local copy which gets removed if you unsync (and files are kept in the cloud).

If by “backup stuff” you mean items that you’d like to keep in the cloud, I want to confirm: are backup1.tar.gz, backup2.tar.gz, ... backupN.tar.gz located outside the 1-way sync dir? And you’ll move them into the 1-way sync dir (that is currently 2-way), then unsync so all of that would be kept in the cloud? Let me know if I missed anything!

To address some questions:

otherwise, is there a way to tell insync that 1-way-sync is a dir which content is to be 1-wayed, but not the dir itself (or it disappears locally, and the process cannot be automatized)?

  • Top-level folders synced 1-way cannot have have a different sync direction from its contents (no mix and match as explained in the guide above). Meaning, if Folder A has Files A, B, and C, the files will follow the folder’s sync mode.

Re: bash script, I’ll check it with our Linux team.

Thank you for the prompt reply.

The goal is

  • a dir that remains both side, locally and remotely, let’s call it backups (under basedir), a 2-way dir
  • and whatever file is thrown locally in that dir backups is copied to the cloud (by insync), then removed locally by insync (so I guess this is a 1-way sync of these files)

Then I make a backup script that copies whatever is to be for backup inside that backups dir and tada…

The only problem I see is that backups has to be 2-way sync in order to remain locally (ok), but the files thrown in backups have to be “unsynced”, and this is to be done manually I guess (not ok). That means each time something goes for backup, I have to open the interface and mark manually all the files within backups as 1-way.

We need some kind of directory type “I am 2-way but any file copied inside me are automatically flagged 1-way” (or equivalent).

I guess the headless version can probably do that within a script, but headless is a yearly subscription (while the headful is a 1 time payment), and we have too many subscriptions already (besides Google itself).

About our situation, we have a Google Workspace Standard account with 2 TB which we don’t use. So, why not using it for backups? But it seems Drive is not really made for that (no tool globally, let alone on the command line). insync could be the solution (it’s the only capable soft it seems, based on reviews).

But, tbh, if that happens to be too convoluted, we’ll downgrade the Google account and use Amazon storage (backup plans available, linux sync tools on the command line, and it’s cheaper, with no limit). The only reason we keep Google is that this account does other things, and we don’t want to multiply subscriptions.

Hi! Yup, seems like your workflow is specific such that you need a way to automatically remove the local copy (ie unsync) after it’s synced to the cloud. There is currently no direct feature that supports this and I’d like to apologize for the trouble! :sweat:

While there is a way to do it manually, perhaps this particular automation is something I can raise as a feature request. It’s not a behavior that I’ve seen other users look for in the past, but having this as a public forums post can help gain the traffic it needs. :slight_smile: I edited the title and funneled it under feature requests, if that helps!