Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better sync resolution #24

Open
thomaswilburn opened this issue Jun 14, 2021 · 0 comments
Open

Better sync resolution #24

thomaswilburn opened this issue Jun 14, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@thomaswilburn
Copy link
Contributor

We want to be able to have more control over the synchronized asset folder, making it possible to clean it up (currently, once an item is synced, it's very hard to get rid of it or move it).

The use of sentinel filenames and command line flags probably provides the solution:

Default sync resolution

  1. If a file does not exist on the local but does exist on remote (or vice versa), it's copied so that it exists in both places.
  2. If a file exists in both places, the newer file is treated as the source, and copied over the older versions.
  3. If the remote file has the suffix _deleted (or another sentinel, it's not important), it will be removed from the local folder.

--push

  1. Local files are pushed up and replace any remote files.
  2. No files are downloaded or deleted locally.

--push --force

  1. Same process as regular --push, except
  2. If a file is on the remote but not local, it is renamed on the remote with the _deleted suffix so that it will be removed from other clients.
  3. If the remote folder has a _deleted file but we have a local file with the same name, the _deleted file is removed and the local file is uploaded.

--pull

  1. Remote files are downloaded only.
  2. If a file is marked with _deleted on the remote, it's removed from the local.
  3. No files are uploaded.

We should also probably add a --file=PATTERN flag to support filtering a subset of files from the local/remote, which would make it easier to selectively update the folder with deletions.

@thomaswilburn thomaswilburn added the enhancement New feature or request label Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants