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 when using the file stand lone #7

Open
athom opened this issue Apr 29, 2015 · 10 comments
Open

syntax error when using the file stand lone #7

athom opened this issue Apr 29, 2015 · 10 comments

Comments

@athom
Copy link

athom commented Apr 29, 2015

docker@boot2docker:$ sh docker-cleanup-volumes.sh
docker-cleanup-volumes.sh: line 10: syntax error: unexpected "("
docker@boot2docker:
$

@diezcode
Copy link

++ 1
and

cleanup.sh: 3: set: Illegal option -o pipefail

@diezcode
Copy link

Error HERE
allvolumes+="${vid##*/}"

allvolumes+="${bmv}"

@derek-adair
Copy link

im sure the author would accept a PR ;)

@athom
Copy link
Author

athom commented Apr 29, 2015

finally I solve my problem using such single command line :P

docker ps -a |  awk -F" " 'NR>1 {print $1}' | xargs docker rm -v

@diezcode
Copy link

this command clean up your volumes? without removing the active or used volumes?

@athom
Copy link
Author

athom commented Apr 29, 2015

sweep all volumes, i am afraid that the active ones are removed too. just my special case

@athom
Copy link
Author

athom commented Apr 29, 2015

you might want this tool, maybe better than the shell script.

@chadoe
Copy link
Owner

chadoe commented Apr 29, 2015

Hi, docker-cleanup-volumes.sh is a bash script, boot2docker does not have bash installed by default so you either have to install bash on it or use the docker image for this script.
Also @derek-adair is correct, PR's are welcome :)

@piccaso
Copy link

piccaso commented May 5, 2015

boot2docker comes with bash (mingw) but its old...

$ echo $BASH_VERSION
3.1.23(6)-release

not sure if backporting makes sense, but the dockerized version works fine if you ssh into the VM.
run Boot2Docker Start an then:

boot2docker ssh
# wait until connection is established...
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes --dry-run

Btw: to paste the docker run ... line use the mouse/context menu, keyboard shortcuts dont work here.

@dobsiin
Copy link

dobsiin commented Jul 13, 2015

there is some error when running without --dry-run option:

[vagrant@devenv docker-cleanup-volumes]$ sudo sh docker-cleanup-volumes.sh
docker-cleanup-volumes.sh: line 61: $1: unbound variable

commented # the lines of the --dry-run option and this script works just fine!

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

6 participants