Cloud Shell Time Out

1,030 views
Skip to first unread message

James SEYMOUR

unread,
Dec 6, 2018, 12:26:20 AM12/6/18
to GAM for G Suite
Is there a way to stop the Cloud Shell from continuing until the process has finished? At the moment, if left unattended, the session will disconnect and the command that is running will stop.

Thanks

James

+KimNilsson

unread,
Dec 6, 2018, 3:21:47 AM12/6/18
to GAM for G Suite
James, you need to set up a Compute Engine instead.
If you use the tiniest model it's still free, and can run 24/7, meaning you can use cronjobs and other goodies.

Just lower your GAM threads down to max 5, since the tiniest model has only 600MB RAM, whereas a regular Cloud shell has 1.7GB RAM.

✉ Kevin Melillo

unread,
Dec 6, 2018, 8:28:57 AM12/6/18
to google-ap...@googlegroups.com
Wow.  I did not realize that it would time out during an execution.  I guess I have not had really long executions.  What process took that long?

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/8e71699b-c96d-463a-ae3a-ae3ec99ce400%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
photo
Kevin Melillo
Electronic Communications Analyst, Information Technology

Phone: 732.465.6609 | Mobile: 732-609-4331

Email: k.me...@ieee.org

445 Hoes Lane Piscataway, NJ 08854

James SEYMOUR

unread,
Dec 6, 2018, 7:16:32 PM12/6/18
to GAM for G Suite
Hi Keven,

I was testing the command below, which should output to a Google Sheet all the files with the "anyone with the link can view". Don't really need this, at the moment, but I trend to take any command show on this group and get it working for me, in case I need it.

gam config all users print filelist fields id,title,permissions permissionmatch type anyone endmatch todrive


On Thursday, 6 December 2018 21:28:57 UTC+8, k.melillo wrote:
Wow.  I did not realize that it would time out during an execution.  I guess I have not had really long executions.  What process took that long?

On Thu, Dec 6, 2018 at 3:21 AM +KimNilsson <there.is.no...@gmail.com> wrote:
James, you need to set up a Compute Engine instead.
If you use the tiniest model it's still free, and can run 24/7, meaning you can use cronjobs and other goodies.

Just lower your GAM threads down to max 5, since the tiniest model has only 600MB RAM, whereas a regular Cloud shell has 1.7GB RAM.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

James SEYMOUR

unread,
Dec 6, 2018, 8:43:59 PM12/6/18
to GAM for G Suite
Following on from this, you can breakdown the command to run for OUs (and sub OUs) using this command.

gam config ou_and_children_ns <top level OU> print filelist fields id,title,permissions permissionmatch type anyone endmatch todrive

James SEYMOUR

unread,
Sep 25, 2019, 7:39:00 PM9/25/19
to GAM for G Suite
Hi Kim,

Hope you had a good summer break.

I have just got round to setting up a GAM instance on Google Compute Engine. I have set up a VM and installed GAMADV-XTD3 and all seems to be working fine. However, when I left work last night, my computer went to sleep and the VM stopped. Is this expected?

Do I have to apply a setting like this (taken from this page)

sudo
/sbin/sysctl -w net.ipv4.tcp_keepalive_time=60 net.ipv4.tcp_keepalive_intvl=60 net.ipv4.tcp_keepalive_probes=5

​Cheers

James

Kim Nilsson

unread,
Sep 26, 2019, 2:22:37 AM9/26/19
to Google Apps Manager
Hi, James!

Definitely not. 
Unless you created a Compute Engine with a desktop OS. Those may have power saving features, but a simple Debian machine shouldn't do so. 

The compute engine has no connection to your personal computer at all. So no matter what happens to your computer, the CE should keep running almost forever.

/Kim 

James SEYMOUR

unread,
Sep 29, 2019, 7:23:45 PM9/29/19
to GAM for G Suite
Hi Kim,

Thanks for the info. I have not installed a desktop, just working in the terminal. 

I now realise I should have started the command in a screen session to make it easier to reconnect when the terminal window closes and to prevent the command stopping when the terminal window closes.

I don't suppose there is any way to tell GAM to restart the last command from where it left off. My terminal crashed around W in the alphabet of a domain wide command :(. If not I will just edit the CSV of users and continue running again.

Cheers

James

Kim Nilsson

unread,
Sep 30, 2019, 1:03:25 AM9/30/19
to Google Apps Manager
Editing the csv is the best solution now. 

You would have needed to have had such a failsafe check in place the first time you ran the command. 

Kim Nilsson

unread,
Sep 30, 2019, 1:12:09 AM9/30/19
to Google Apps Manager
Also, I must recommend tmux before screen. Its window and pane features are superior to screen, in my experience.

On my Linux computer at home I run tmux with five panes all visible at the same time. All within a single tmux session, so if I detach from it, I can reattach to it from any other place, and all five will come back with the same layout as I created them.

Four of them have live data from irssi, top, flexget and rtorrent, with the fifth just being a shell with mc, so I can run commands in it. 

Steve Larsen

unread,
Sep 30, 2019, 8:54:15 AM9/30/19
to Google Apps Manager
Kim - Thank you for adding a few hours to my day to learn something new. It needed some filling up, only two meetings scheduled for today :)

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAGPzzFvqepyEi6fL9FyLRPrFS_Q3d%2BxhSdJaK2%3DXQNRq-ry33w%40mail.gmail.com.

Kim Nilsson

unread,
Sep 30, 2019, 5:45:59 PM9/30/19
to Google Apps Manager
I aim to please. :-)

/Kim
--
There is No Substitute!

James SEYMOUR

unread,
Oct 2, 2019, 3:45:51 AM10/2/19
to GAM for G Suite
Hi Kim,

Unfortunatley I realised that the CSV was the email addresses (of non-existent users) I was trying to purge from the users contact lists, so I have just had to start running the command again.

Thanks for the info on tmux, I have heard of others using this and will add it to the list of things to do, but I struggle getting one terminal session running, let alone 5 :). But the next task for Computer Engine, when the current command finishes, is to install Stackdriver and set up some basic CPU monitoring, to be notified when a command has stopped running.

Cheers

James

Kim Nilsson

unread,
Oct 2, 2019, 6:44:57 AM10/2/19
to Google Apps Manager
Cool, do keep us updated.
Maybe a link to a shared Document where you note your progress, so you don't have spam this thread with successes and setbacks. 😊

James SEYMOUR

unread,
Oct 2, 2019, 8:42:44 PM10/2/19
to GAM for G Suite
Sure. I have started to make some notes here https://sites.google.com/jis.edu.bn/gam-commands/systems/compute-engine and will update as I progress.

Markus Frömmel

unread,
Oct 3, 2019, 3:15:04 AM10/3/19
to GAM for G Suite
Thank you for the interesting information. I also thinking about setting one up. Do you recommend a particular OS or any special configuration for the os or for gam besides the max threats? 

James SEYMOUR

unread,
Oct 3, 2019, 4:27:37 AM10/3/19
to GAM for G Suite
Hi Markus,

I just followed this guide https://cloud.google.com/compute/docs/quickstart-linux and kept my choice to Debian 9. Debian 10 is also available, but stuck to 9 to follow the guide exactly. For my next one I would probably choose Ubuntu 18.04 LTS, as this is what I run at home so could test on that if needed, although as Ubuntu us based on Debian they should behave very similar.

By default I think the threads are set to 5, which is what I ended up with. My CPU usages has not gone over about 60%.

Steve Larsen

unread,
Oct 5, 2019, 11:49:59 AM10/5/19
to Google Apps Manager
For anyone sticking to Cloud Shell this is a good resource to review to know of the limitations with it. It's great for the occasional use but for long running commands, cron jobs, always on use of course it's not ideal (nor possible). The main ones relevant to gam use I think are below, all in the link

Cloud Shell inactivity: If you do not access Cloud Shell for 120 days, your home disk will be deleted. You will receive an email notification before its deletion and simply starting a session will prevent its removal. Please consider a different solution on Google Cloud Storage for sensitive data you wish to store long term.

Non-interactive usage: Cloud Shell is intended for interactive use only. Non-interactive sessions will be ended automatically after a warning. Note that Cloud Shell sessions are capped at 12 hours, after which sessions are automatically terminated. You can use a new session immediately after.

Weekly usage: Cloud Shell also has weekly usage limits. If you reach your usage limit, you'll need to wait until the specified time (listed under Usage Quota, found under the three dots menu icon) before you can use Cloud Shell again. 

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages