snapsync icon indicating copy to clipboard operation
snapsync copied to clipboard

Can't manually sync a snapper configuration with same name as target folder

Open automorphism88 opened this issue 7 years ago • 2 comments

I recently downloaded snapsync and noticed that my default snapper configuration named root for my / subvolume would not sync to the folder I had set up with snapsync init, with Thor throwing an EISDIR error saying root was a directory and exiting.

After some trial and error I discovered that renaming my snapper configuration from root to something else solved the issue. Otherwise it's working well, thanks for your work.

EDIT: I discovered the error actually results from having the target directory with the same name as the snapper config you want to sync to it, regardless of whether that's root or something else. It doesn't matter if the full path is given or not, just what the top level directory is called (i.e. snapsync sync foo /mnt/snapsync/foo produces the same effect as cd /mnt/snapsync && snapsync sync foo foo). This is a natural naming scheme for users who want to sync some, but not all, of their snapper configurations.

automorphism88 avatar Aug 27 '17 13:08 automorphism88

Could you attach a backtrace ? Thanks.

doudou avatar Aug 30 '17 16:08 doudou

Turns out it only happens if you refer to the target directory with relative path. If you have a snapsync configuration called bar and you want to sync it into /foo/bar then cd /foo && snapsync sync bar barwill produce an error but cd / && snapsync sync bar /foo/bar works fine.

/usr/lib64/ruby/gems/2.4.0/gems/snapsync-0.3.8/lib/snapsync/snapper_config.rb:111:in `readlines': Is a directory @ io_fillbuf - fd:7 thunderbird (Errno::EISDIR)
	from /usr/lib64/ruby/gems/2.4.0/gems/snapsync-0.3.8/lib/snapsync/snapper_config.rb:111:in `readlines'
	from /usr/lib64/ruby/gems/2.4.0/gems/snapsync-0.3.8/lib/snapsync/snapper_config.rb:111:in `load'
	from /usr/lib64/ruby/gems/2.4.0/gems/snapsync-0.3.8/lib/snapsync/snapper_config.rb:86:in `load'
	from /usr/lib64/ruby/gems/2.4.0/gems/snapsync-0.3.8/lib/snapsync/cli.rb:17:in `config_from_name'
	from /usr/lib64/ruby/gems/2.4.0/gems/snapsync-0.3.8/lib/snapsync/cli.rb:69:in `sync'
	from /usr/lib64/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	from /usr/lib64/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	from /usr/lib64/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	from /usr/lib64/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	from /usr/lib64/ruby/gems/2.4.0/gems/snapsync-0.3.8/bin/snapsync:4:in `<top (required)>'
	from /usr/bin/snapsync:9:in `load'
	from /usr/bin/snapsync:9:in `<main>'

automorphism88 avatar May 12 '19 00:05 automorphism88