Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

run command async without foreground #284

Closed
omerh opened this issue Nov 4, 2020 · 7 comments
Closed

run command async without foreground #284

omerh opened this issue Nov 4, 2020 · 7 comments

Comments

@omerh
Copy link

omerh commented Nov 4, 2020

Hi,

Just trying out the cli tool, I was wondering if there is an option to run it without --poll-interval ?
I want to run a snapshot script and I don't need to see the progress of the snapshot creation.

I tough of --poll-interval -1 or something

@LKaemmerling
Copy link
Member

Currently, there is no way to disable the progress bar at the moment.

Do i understand it correctly, that you just want to disable the progress bar, but the command should still wait until the snapshot is created?

Specifying the poll-interval should only be used when you run into the rate limit.

@omerh
Copy link
Author

omerh commented Nov 5, 2020

Hi,
Not exactly, I don't want to see the progress and don't want to wait until its finished.
Just send an async request for snapshot

I've made this https://github.com/omerh/hetzner-hcloud-snapshots and I don't need to wait till its done

@LKaemmerling
Copy link
Member

But then you will never know if the snapshot is ready (useable) or not?

@omerh
Copy link
Author

omerh commented Nov 5, 2020

Im counting on Hetzner to succeed in snapshot (like I do in AWS and DO)
If it may break than you can leave it and close the issue 👍

@ktomk
Copy link
Contributor

ktomk commented Nov 5, 2020

For me with hcloud cli it works pretty well redirecting stdout to /dev/null - this effectively removes the progress-bar.

Stderr is untouched as I normally want to see the errors (could be misconfiguration / changes as well), when unattended all output is also turned into a notification, so I only want the errors.

Can imagine that to prevent the output of the progress bar and run in background in your script could do:

hcloud server create-image --type snapshot --label id=$1 \
     --description server-$1 --poll-interval 0 $1 >/dev/null &
                                                  ########## #

Is this what you're looking for?

@omerh
Copy link
Author

omerh commented Nov 5, 2020

Yes. But builtin the command and not directing to /dev/null

@LKaemmerling
Copy link
Member

I would still recommend directing it to /dev/null. Your "use case" is really limited, and you should always expect that there might be a problem or something else and then react to it. Therefore i think given people such an option would confuse them more than it would help them.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants