Email Notification when Command finishes

136 views
Skip to first unread message

James SEYMOUR

unread,
Sep 1, 2022, 1:02:49 AM9/1/22
to GAM for Google Workspace
Hi,

I tried to see if this has already been covered, but couldn't find anything.

Is there a way to get notified when a command finishes? There is the option for the todrive (although I have the email & browser options turned off) but I am looking for something similar when running a "copy drivefile" command.

I am using gam csv gsheet <User Email Address> <Sheet ID> Sheet1 gam user ~SharedDriveUser copy drivefile ~FolderToCopyID excludetrashed recursive copytopfolderpermissions false copyfilepermissions false copysubfolderpermissions false teamdriveparentid ~SharedDriveID newfilename "~NewName". This is creating a copy of a Shared Drive folder and I would like to know when it has completed.

Thanks in advance.

James

Ian Crew

unread,
Sep 1, 2022, 10:02:31 AM9/1/22
to google-ap...@googlegroups.com
You could just do that natively in Unix, no need for an extra GAM command. For example:

gam print users ; echo "body" | mailx -s "subject" f...@bar.com

The mail command won’t execute until the GAM command finishes.

Hope that helps,

Ian 

Jerudong International School
https://www.jerudonginternationalschool.com
Follow us on:
http://www.facebook.com/jisbruneidarussalam http://www.twitter.com/jisbrunei http://www.instagram.com/jisbrunei https://www.youtube.com/user/JISBrunei https://www.flickr.com/photos/133960569@N03/albums

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" 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/9237f2ee-c04e-4374-b0cc-704f46d4e2ban%40googlegroups.com.
--
Ian Crew

Solutions Architect
Productivity & Collaboration Services
Information Services and Technology

Jay Lee

unread,
Sep 1, 2022, 10:19:49 AM9/1/22
to google-ap...@googlegroups.com
You can also just have GAM email you. If you saved the results to a file that can be the body:


James SEYMOUR

unread,
Sep 1, 2022, 7:51:37 PM9/1/22
to GAM for Google Workspace
Thanks Ian & Jay,

In the end I went with Jay's suggestion, to keep it all within GAM. For me, running GAMADV-XTD3 in the cloud (on Linux) I opted for this solution.

gam <Full GAM Command> && gam user <User Email Address> sendemail subject "<Subject Line Text>" recipient <Recipient Email Address>

Generally I will be the recipient and will only need the subject line to convey the message that the command has finished. But it does open up possibilities for informing other users if needed.

Cheers

James

James SEYMOUR

unread,
Sep 1, 2022, 9:54:15 PM9/1/22
to GAM for Google Workspace
Although this may be more 'accurate'

gam <Full GAM Command> && gam sendemail recipient <Recipient Email Address> subject "<Subject Line Text>"  from <User Email Address> 
Reply all
Reply to author
Forward
0 new messages