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

Different paths for different hosts #7

Open
jkoop opened this issue Sep 6, 2020 · 3 comments
Open

Different paths for different hosts #7

jkoop opened this issue Sep 6, 2020 · 3 comments

Comments

@jkoop
Copy link

jkoop commented Sep 6, 2020

Let's say I want to synchronise my home directory on two computers (alfa, and bravo), but my username (and therefore, the path of my home dir) are different.

Perhaps a sneakersync.cfg like this:

modules:
  - root:
    - alfa: /home/username
    - bravo: /home/something-else

And if I try to sync with a third computer (charlie), it should die with an error like so:

Error: hostname "charlie" not found in sneakersync.cfg
@lamyj
Copy link
Owner

lamyj commented Sep 7, 2020

Interesting idea; should be not too difficult to implement. Do you assume that the home dirs are strictly the same or that some content is specific to each computer? In the former case, we can keep your config scheme as is, while in the latter we will probably need to add host-specific include/exclude filters.

@jkoop
Copy link
Author

jkoop commented Sep 7, 2020

It would be nice to have host-specific *clude filters, but I'll make that a separate issue.

@lamyj
Copy link
Owner

lamyj commented Sep 20, 2020

This should be solved by e957205. The behavior is the same as before if the module root is a string (i.e. use it on all hosts), and I followed the behavior you defined in your first comment: use host-specific root if defined, fails if host is not defined.

Note that I'm using the hostname as returned by socket.gethostname: depending on the system, it may not be the FQDN. Let me know if it works for you or if I need to look for both gethostname and getfqdn.

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

2 participants