This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 1. After deploy, update the function URL in index.html | |
# 2. If you rename myCloudFunction, change it here, index.js and index.html | |
# 3. The HTML file must be served from a server | |
# (or locally via something like $ python3 -m http.server) | |
gcloud functions deploy myCloudFunction \ | |
--gen2 \ | |
--runtime=nodejs20 \ | |
--region=us-central1 \ | |
--source=. \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2018, Google, Inc. | |
// Licensed under the Apache License, Version 2.0 (the 'License'); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an 'AS IS' BASIS, | |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is not an official Google product. | |
# Copyright 2016 Google Inc. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /home/bret/db_backups | |
DATE=$(date +"%Y%m%d%H%M") | |
# Export the MySQL database | |
mysqldump -u backup_user -p secret_password --all-databases | gzip --rsyncable > backup_db_$DATE.sql.gz | |
# Keep at most 30 files | |
ls -t | sed -e '1,30d' | xargs -d '\n' rm |