GAM-team / got-your-back

Got Your Back (GYB) is a command line tool for backing up your Gmail messages to your computer using Gmail's API over HTTPS.
https://github.com/GAM-team/got-your-back/wiki
Apache License 2.0
2.64k stars 209 forks source link

{Feature Request] Multiple concurrent gyb instances, to process different mailboxes #311

Closed wicknet closed 3 years ago

wicknet commented 3 years ago

Kudos for this wonderfully effective tool that we use to help our departing employees transfer their work emails to personal accounts. SO much easier than Google Takeout.

While feeding gyb one email account at time on Ubuntu 20.04 server works flawlessly, it is not super-efficient to quickly backup 18 or 20 mailboxes during summer, when we see some employees rotate out.

gyb --email user1@domain.org --action backup --batch-size 49 --service-account wait for it to finish... gyb --email user2@domain.org --action backup --batch-size 49 --service-account ....and so on

Is there any built-in feature or workaround or additional linux package you can suggest to run multiple instances of gyb concurrently for different accounts, each in its own tab/window on a Ubuntu/Debian server OS? Don't really want to use Windows or Mac workstations, for security.

Any help is deeply appreciated.

paour commented 3 years ago

You can easily use screen to process multiple users in parallel (bonus: if you get disconnected, it keeps running). But you could also run them all in the same shell session as background jobs (just add & at the end of each command line). If you want to do a bit of scripting, it's easy to just pass a list of usernames and have a loop to start all these backups concurrently.

wicknet commented 3 years ago

Thanks for the tip. I have looked up screen command - it seems interesting but as usual the available options look daunting. Using one long command with "&" in between 20+ backups seems dicey to me. Would you be able to suggest how to do this with screen for the following 3 individual commands once I'm logged into the server via ssh?

./gyb --email user1@mydomain.org --action backup --fast-incremental --batch-size 49 --service-account ./gyb --email user2@mydomain.org --action backup --fast-incremental --batch-size 49 --service-account ./gyb --email user3@mydomain.org --action backup --fast-incremental --batch-size 49 --service-account and so on?

Appreciate any details.

paour commented 3 years ago

If you're launching manually, you can press ctrl-a c to create a new screen, between each gyb command.

wicknet commented 3 years ago

Thank you.. I did gather that already from a cursory reading of screen's man page.

My request is for an automated way to launch multiple gyb backup or restore sessions after logging in via ssh, without needing to copy and paste commands in individual screens.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.