eclipse 有没有办法告诉 Dropbox 不要上传某个文件?(日食相关)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12119613/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 18:51:07  来源:igfitidea点击:

Is there a way to tell Dropbox not to upload a certain file? (Eclipse related)

eclipsedropbox

提问by tyler

I am trying to sync a code project between two computers, one running Windows and the other running Ubuntu 12.04. I use Eclipse on both machines, but the .metadatafolder produced by Eclipse is causing Eclipse to crash because of OS incompatibilities.

我正在尝试在两台计算机之间同步代码项目,一台运行 Windows,另一台运行 Ubuntu 12.04。我在两台机器上都使用 Eclipse,但是Eclipse 生成的.metadata文件夹导致 Eclipse 由于操作系统不兼容而崩溃。

I was wondering if there is a way to tell Dropbox to "ignore this folder" or something like that. Or maybe have it ignore all hidden files.

我想知道是否有办法告诉 Dropbox“忽略这个文件夹”或类似的东西。或者让它忽略所有隐藏文件。

回答by Software Engineer

Using the Official Dropbox Command Line Interface (CLI)

使用官方 Dropbox 命令行界面 (CLI)

PROMPT$ dropbox help exclude
dropbox exclude [list]
dropbox exclude add [DIRECTORY] [DIRECTORY] ...
dropbox exclude remove [DIRECTORY] [DIRECTORY] ...

"list" prints a list of directories currently excluded from syncing.
"add" adds one or more directories to the exclusion list, then resynchronizes Dropbox.
"remove" removes one or more directories from the exclusion list, then resynchronizes Dropbox.
With no arguments, executes "list".
Any specified path must be within Dropbox.

http://www.dropboxwiki.com/tips-and-tricks/using-the-official-dropbox-command-line-interface-cli

http://www.dropboxwiki.com/tips-and-tricks/using-the-official-dropbox-command-line-interface-cli

回答by f4lco

Right click on the taskbar icon, select preferences, then the advanced tab and set up selective sync. Enabling advanced view will help, too.
In general, you should consider using a version control system like Subversion, Mercurialor git. You can make use of free hosting services (Assembla, Github, Bitbucketjust to name a few) or set up a repository on a USB drive (works very well for personal projects).

右键单击任务栏图标,选择首选项,然后选择高级选项卡并设置选择性同步。启用高级视图也会有所帮助。
一般来说,您应该考虑使用像SubversionMercurialgit这样的版本控制系统。您可以使用免费托管服务(AssemblaGithubBitbucket仅举几例)或在 USB 驱动器上设置存储库(非常适合个人项目)。

回答by MetalloyD

If you're checking this in or after 2020, you can follow the official way to ignore a file/folder from syncing to dropbox from your computer.

如果您在 2020 年或之后进行检查,您可以按照官方方式忽略文件/文件夹从您的计算机同步到 Dropbox。

Although, at the time of writing this post, the feature is still in Beta.

尽管在撰写本文时,该功能仍处于测试阶段。

https://help.dropbox.com/files-folders/restore-delete/ignored-files

https://help.dropbox.com/files-folders/restore-delete/ignored-files

ignoringis different from excluding.

ignoring不同于excluding.

  • Dropbox excluderemoves the folder from your machine altogether. The file/folder does, however, stay on Dropbox's servers. Excluded folders can be included back onto your machine whenever you choose by going to the dropbox app's settings.
  • ignorelets you keep the file or folder on your machine but doesn't sync the file or folder to Dropbox at all. That means the folder only lies on your current machine and not on Dropbox.
  • Dropboxexclude会从您的计算机中完全删除该文件夹。但是,文件/文件夹会保留在 Dropbox 的服务器上。只要您选择转至 Dropbox 应用程序的设置,就可以将排除的文件夹包含回您的计算机。
  • ignore允许您将文件或文件夹保留在您的计算机上,但根本不会将文件或文件夹同步到 Dropbox。这意味着该文件夹仅位于您当前的计算机上,而不位于 Dropbox 上。

For example:

例如:

  1. You would choose dropbox excludeto exclude a big backup file that you don't have space for or don't need on your machine. The file/folder will still exist on Dropbox.

  2. You would choose to ignorefolders from syncing to dropbox when your folder contains thousands or millions of temporary files that aren't necessary to be backed up. Backing up such a folder could cause Dropbox to use a lot of CPU cycles and RAM on your computer to keep track of all the changes to your files. This might slow down your computer.

    • An example of such a folder is node_moduleswhich get installed in a node project directory. node_moduleshave quite a number of files within them which can be safely ignored from syncing to Dropbox and recreated by doing a npm installat any point in time.

    • You might also choose to ignore environment variable files containing secret keys to your web server or your ssh private keys. This could be useful while sharing folders across teams on Dropbox.

  1. 您会选择dropbox exclude排除您的计算机上没有空间或不需要的大备份文件。该文件/文件夹仍将存在于 Dropbox 上。

  2. ignore当您的文件夹包含数千或数百万个不需要备份的临时文件时,您会选择将文件夹从同步到 Dropbox。备份此类文件夹可能会导致 Dropbox 使用您计算机上的大量 CPU 周期和 RAM 来跟踪对文件所做的所有更改。这可能会降低您的计算机速度。

    • 此类文件夹的一个示例是node_modules安装在节点项目目录中。node_modules其中有相当多的文件,在同步到 Dropbox 时可以安全地忽略这些文件,并npm install在任何时候通过执行 a 重新创建。

    • 您还可以选择忽略包含 Web 服务器的密钥或 ssh 私钥的环境变量文件。在 Dropbox 上跨团队共享文件夹时,这可能很有用。

How to Exclude: - To exclude a file from syncing from dropbox to your computer, you would need to either:

如何排除: - 要排除文件从 Dropbox 同步到您的计算机,您需要:

  • All platforms:Change the folders to sync in the selective syncsettings in the Dropbox app.
  • Linux Dropbox CLI:Or run the command dropbox exclude add "FULL_PATH_TO_FILE_OR_FOLDER_TO_EXCLUDE"in your terminal.
  • 所有平台:selective sync在 Dropbox 应用的设置中更改要同步的文件夹。
  • Linux Dropbox CLI:dropbox exclude add "FULL_PATH_TO_FILE_OR_FOLDER_TO_EXCLUDE"在终端中运行命令。

How to Ignore

如何忽略

To ignore a file from getting synced from your computer to Dropbox, you'd need to run the following commands in the terminal while changing the FULL_OR_RELATIVE_PATH_TO_FILE_IN_DROPBOXin the commands below to the file/folder you need to exclude:

要忽略从计算机同步到 Dropbox 的文件,您需要在终端中运行以下命令,同时将以下命令中的 更改为FULL_OR_RELATIVE_PATH_TO_FILE_IN_DROPBOX您需要排除的文件/文件夹:

Mac:

马克

  1. alias dropboxignore="xattr -w com.dropbox.ignored 1"
  2. dropboxignore "FULL_OR_RELATIVE_PATH_TO_FILE_IN_DROPBOX"
  1. alias dropboxignore="xattr -w com.dropbox.ignored 1"
  2. dropboxignore "FULL_OR_RELATIVE_PATH_TO_FILE_IN_DROPBOX"

Linux:

Linux

  1. alias dropboxignore="attr -s com.dropbox.ignored -V 1"
  2. dropboxignore "FULL_OR_RELATIVE_PATH_TO_FILE_IN_DROPBOX"
  1. alias dropboxignore="attr -s com.dropbox.ignored -V 1"
  2. dropboxignore "FULL_OR_RELATIVE_PATH_TO_FILE_IN_DROPBOX"

Windows - Powershell:

Windows-Powershell

Set-Content -Path "FULL_OR_RELATIVE_PATH_TO_FILE_IN_DROPBOX"
    -Stream com.dropbox.ignored -Value 1

回答by Jim Morrison

You can name the file in such a way that Dropbox considers it a temporaryfile, which will prevent it syncing.

您可以将文件命名为 Dropbox 将其视为临时文件的方式,这将阻止其同步。

eg. .~myfile.foo

例如。 .~myfile.foo

According to their help: https://www.dropbox.com/en/help/145-

根据他们的帮助:https: //www.dropbox.com/en/help/145-

Temporary files

When some applications (such as Microsoft Word, Excel, or PowerPoint) open a file, they will often save a temporary file in the same directory and name it in one of the following ways:

Name begins with ~$ (a tilde and dollar sign) or .~ (a period and tilde)

  • Name begins with a tilde and ends in .tmp, such as ~myfile.tmp
  • Dropbox does not sync these temporary files on any operating system.

临时文件

当某些应用程序(如 Microsoft Word、Excel 或 PowerPoint)打开文件时,它们通常会在同一目录中保存一个临时文件,并以下列方式之一为其命名:

名称以 ~$(波浪号和美元符号)或 .~(句点和波浪号)开头

  • 名称以波浪号开头并以 .tmp 结尾,例如 ~myfile.tmp
  • Dropbox 不会在任何操作系统上同步这些临时文件。