sh 将文件从files目录复制到所有三个存储桶

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 将文件从files目录复制到所有三个存储桶相关的知识,希望对你有一定的参考价值。

# It is easier to work with two terminal tabs open so you can have all the information in one place. Open two tabs and log in to your chosen server in both tabs.

# In one tab, do the following (this is our standard directory for storing these config files):

cd /home/username/landmark-deployments

# Run the following command to find out the current status of the installation you wish to upload to
# Replace config_filename_no_extension with the config filename without the extension.
# For example, 'corp.xml' would become 'corp':

python syncscript.py config_filename_no_extension status

# This should give an output like the following:

# Live = "landmarkCorp1"
# Site is currently Running
# Staging = "landmarkCorp2"
# Site is currently Running

# Being aware of this information, you will need to run the following steps.

# 1. cd into your websites' sites directory.
cd /var/www/html/krisyoung/landmark-corp/sites

# 2. Set ownership on default to yourself.
# This isn't a problem as the folder is no longer in use while everything goes through the Buckets.

# 3. cd into the sites/default/files directory, go to that same directory in your FTP client

# 4. Drag the file you want to copy, into that folder.

# 5. Run the following commands, one after the other.

export AWS_ACCESS_KEY_ID=AKIAJGQ57M6F7ZVRLXMA
export AWS_SECRET_ACCESS_KEY=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

# 6. Run the following commands, being aware of the three Bucket names.

aws s3 cp ./file.png s3://[dev bucket]/s3fs-public/file.png
aws s3 cp ./file.png s3://[staging bucket]/s3fs-public/file.png
aws s3 cp ./file.png s3://[production bucket]/s3fs-public/file.png

# 7. Browse to the file in each Bucket (via your web browser) and be sure that in each case, it's copied across correctly.

以上是关于sh 将文件从files目录复制到所有三个存储桶的主要内容,如果未能解决你的问题,请参考以下文章

如何使用 gsutil 将所有文件和子文件夹从当前目录复制/移动到 Google Cloud Storage 存储桶

将文件从存储桶拆分并复制到另一个存储桶,无需在本地下载

GCP 存储 - 如何创建一个脚本,将所有文件/文件夹从一个存储桶复制到另一个存储桶,但文件夹结构不同

将所有文件从 Amazon S3 存储桶复制到 Microsoft Azure 容器的最佳方法

如何仅将目录下许多子目录中的文件复制到 GCP 中的另一个项目存储桶中?

Cloud Function 将存储桶中的所有文件复制到同一个 GCS 存储桶内的文件夹中