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

[Feature request] rsync exclude option #69

Open
kevinkk525 opened this issue Dec 22, 2018 · 5 comments
Open

[Feature request] rsync exclude option #69

kevinkk525 opened this issue Dec 22, 2018 · 5 comments

Comments

@kevinkk525
Copy link

kevinkk525 commented Dec 22, 2018

Please add the option to exclude files/directories from rsync using the option
rshell -p /dev/ttyS3 rsync source/ /destination/ -exclude images

@peterhinch
Copy link
Contributor

I think there is a more flexible way. First to explain to others the use case.

We have a nested directory structure including a project implemented as a Python package. The structure contains files which are to go on GitHub but aren't program files: README's for example. It would be good if users could clone the repo and install to target hardware using rsync, but without filling the target's filesystem with cruft.

I don't relish implementing the Linux rsync approach which is hard to use, let alone to implement or test. I therefore suggest the following "lite" solution.

Each subdirectory optionally may contain a text file __files__. If it does not exist, rsync's behaviour is as at present.
If it exists, but is empty, no files from that directory are copied. Subdirectories are treated recursively.
If it exists and contains a list of filenames only files matching that name are copied. Again subdirectories are treated recursively. If a specified file does not exist the fact is silently ignored.

__files__ must contain only the names of files in the current directory, one filename per line. Directory specifiers are not allowed. __files__ itself is never copied to the target.

Comments welcome.

As a practical note it may be a while before I get to address this and #70.

@kevinkk525
Copy link
Author

I understand that implementing something as powerful as the linux rsync exclude would be a little too much.

Using files sounds like a good solution in this context.

@dhylands
Copy link
Owner

I would probably lean more towards creating a hidden file, similar in concept to git's .gitignore file, but call it .ignore or .rshell-ignore
This concept could be extended to also allow something like ~/.rshell-ignore which would be like a global filter and a particular directory's .rshell-ignore would be added to that.

@peterhinch
Copy link
Contributor

That sounds OK, but what about Windows and OSX: do these cope with filenames starting with a .?

@dhylands
Copy link
Owner

OSX definitely does.

Windows does except on really old FAT file systems which only support the 8.3 format and don't support long filenames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants