AmesCornish / buttersink

Buttersink is like rsync for btrfs snapshots
GNU General Public License v3.0
193 stars 18 forks source link

Couple of "no such file" errors #5

Closed Jiehong closed 9 years ago

Jiehong commented 9 years ago

Hi!

I mainly use your programme for sync my snapshots on a local drive. Here are some commands that brings errors:

$ buttersink -n /home /var/run/media/username/Backup_Drive
[Errno 2] No such file or directory: '/'
Waiting for btrfs quota usage scan...
No snapshots in source.
Try adding a '/' to '/home'.

Next:

$ buttersink -n /home /dev/mapper/luks-800349b4-b1e6-4b96-b9d7-5a050b191f86
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/buttersink/buttersink.py", line 201, in main
  dest = parseSink(args.dest, source is not None, args.delete, args.dry_run)
File "/usr/lib/python2.7/site-packages/buttersink/buttersink.py", line 183, in parseSink
  return Sinks[parts['method']](host, path, mode, dryrun)
File "/usr/lib/python2.7/site-packages/buttersink/ButterStore.py", line 43, in __init__
  raise Exception("'%s' is not an existing directory" % (self.userPath))
Exception: '/dev/mapper/luks-800349b4-b1e6-4b96-b9d7-5a050b191f86' is not an existing directory

In this example, I simply made a mistake, and put as a second argument the luks container (dm-crypt/LUKS) instead of the btrfs partition inside it. But It probably shouldn't fail like that though.

Some more information:

$ ls -l /dev/mapper/luks-800349b4-b1e6-4b96-b9d7-5a050b191f86
lrwxrwxrwx 1 root root 7 2015-04-17 14:07 /dev/mapper/luks-800349b4-b1e6-4b96-b9d7-5a050b191f86 -> ../dm-0

But:

$ ls -l /dev/dm-0 
brw-rw---- 1 root disk 254, 0 2015-04-17 14:07 /dev/dm-0

Thanks anyway for this tool!

AmesCornish commented 9 years ago

Jiehong,

Thanks for the feedback and for using buttersink.

In the first case, buttersink thinks you want to transfer a single snapshot, called /home, to the remote system, but /home is not a snapshot, so it can't. To indicate you want to transfer all the snapshots in a directory, you need to specify /home/ (note the trailing slash).

In the second case, again buttersink can't do what you're asking, because the destination is not an existing directory. I'll look into clarifying the error messages.

Thanks for the feedback!

Jiehong commented 9 years ago

In the first case, I think the error message is pretty clear, just the "[Errno 2] No such file or directory: '/'" seems weird.

In the second case, the exception is simply different, and not caught.

But it seems that now it does work correctly with your last commit.

Thanks!