Tomb
Tomb copied to clipboard
Space characters in bind-hooks
How can I implement bind-hooks if there is a space character in the path relative to $HOME? I enclosed the path names with "" but it did not work. Then I tried using symlink. Tomb opened without problem, but I was unable to close it with tomb close
and tomb slam
. I am using Tomb 2.9.0. I can not remove the space character from the folder name, because it was created by a software and it won't work if I change it.
Hi! can you please confirm this issue is solved using latest version from git?
Hi @jaromil. It did not work for me. I downloaded the latest version from git, installed it using sudo make install
. Made sure the file "tomb" changed in /usr/local/bin/
.
Let's say this is the path /home/user/.config/Example Folder
which I want to bind-hook to media/ExampleFolder
in tomb.
- First I tried without symlink. But it could not bind-hook:
bind-hooks:
media/ExampleFolder ".config/Example Folder"
Output:
tomb . Commanded to open tomb .doc/secret.tomb
tomb . Valid tomb file found: .doc/secret.tomb
tomb . Key is an image, it might be valid.
tomb . Mountpoint not specified, using default: /run/media/user/secret
tomb (*) Opening secret on /run/media/user/secret
tomb . This tomb is a valid LUKS encrypted device.
tomb . Cipher is "twofish" mode "xts-plain64" hash "sha512"
tomb . A password is required to use key .....
tomb [W] Attempting key recovery.
tomb . Password OK.
DM-UUID for device tomb.secret.d52da4cfad13566f9c357890434340a54752285bd92d14589740aedc17671561.loop14 was truncated.
tomb (*) Success unlocking tomb secret
tomb . Filesystem detected: ext4
tomb . Checking filesystem via /dev/loop14
fsck from util-linux 2.37.4
secret: clean, 24238/3399680 files, 10277943/13567488 blocks
tomb (*) Success opening secret.tomb on /run/media/user/secret
tomb . Last visit by user(1000) from /dev/pts/1 on user-pc
tomb . on date Mon 07 Mar 2022 10:36:37 AM +03
tomb [W] bind-hook target not existent, skipping /home/user/".config/Example
- Then I tried using symlink. This way the bind-hook worked, but then it was impossible to close the tomb either by
tomb close
ortomb slam
.
I created symlink with
ln -s "/home/user/.config/ExampleFolder/" Example
bind-hooks file:
media/ExampleFolder Example
output:
$ tomb close
tomb . Closing tomb [secret] mounted on /run/media/user/secret
tomb . Closing tomb bind hook: /home/.../...
tomb . Closing tomb bind hook: /home/user/.config/Example Folder
umount: /home/user/.config/Example\x20Folder: no mount point specified.
tomb [E] Tomb bind hook /home/user/.config/Example Folder is busy, cannot close tomb.
Am I doing something wrong?
Hello again. As a workaround, I could make it work for me using symlink and then just before closing the tomb, I enter:
sudo umount "/home/user/.config/Example Folder"
or just
sudo umount Example
, where "Example" is the symlink as defined in ln -s "/home/user/.config/ExampleFolder/" Example
then,
tomb close
Could you run tomb with -D for debug output? Just curious if it breaks in the region of line 2501
Could you run tomb with -D for debug output? Just curious if it breaks in the region of line 2501
I tried it and it does not give any line numbers, and I don't know how to debug a bash script. But you could try this by creating this folder structure "/home/user/.config/Example Folder" and try to bind-hook to "media/ExampleFolder" in tomb.
No, it doesn't give line numbers, but in that region are verbose messages which maybe can tell the state of vars. But will try to setup hooks. Never did that before with tomb, so I need to read about this.
This does seem to be fixed by #500, at least as a workaround; you can now escape spaces in the target directory with a backslash. I just tested it and it seems to work.