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

Syntax error with space in pool name. #1

Closed
12nick12 opened this issue Aug 16, 2018 · 5 comments
Closed

Syntax error with space in pool name. #1

12nick12 opened this issue Aug 16, 2018 · 5 comments

Comments

@12nick12
Copy link

./zfs-prune-snapshots: line 145: Shows@data_1534448870 1534448871: syntax error: invalid arithmetic operator (error token is "@data_1534448870 1534448871")

I know it's old and I shouldn't have a space, but any chance you could help fix it? I looked thru the code, but I'm not super good with bash.

@bahamas10
Copy link
Owner

ah! interesting. and that's totally fine - if it's a valid ZFS name then it should work with this script (ie. this script should support it)... i'll have a patch for you in a second.

@12nick12
Copy link
Author

Thanks a million

@bahamas10
Copy link
Owner

bahamas10 commented Aug 16, 2018

Tested and working!

create datasets with space in the name

# zfs create goliath/foo
# zfs create 'goliath/foo/name with spaces' 
# zfs snapshot 'goliath/foo/name with spaces@test'

Prune it successfully

# ./zfs-prune-snapshots -n 1s goliath/foo
removing goliath/foo/name with spaces@test: 18 seconds old <dry-run: no action taken>
# ./zfs-prune-snapshots 1s goliath/foo
removing goliath/foo/name with spaces@test: 26 seconds old
# ./zfs-prune-snapshots 1s goliath/foo
#

If the latest commit doesn't fix it feel free to reopen the issue, thanks :)

@12nick12
Copy link
Author

Thanks for the quick response. I'll let you know.

@12nick12
Copy link
Author

works perfect.

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