COS can be used on Windows mainly with APIs, COSBrowser, or COSCMD.
However, users using Windows Server can only use COSBrowser as cloud storage, which is not friendly to run programs or perform operations. In this case, you can mount the cost-effective COS to Windows Server as local drive by reading this guide.
Note:Examples given in this document apply only to Windows 7 or Windows Server 2012 and later.
The following installation procedure is for your reference. You can perform the installation according to your OS:
Git-2.31.1-64-bit.exe
is downloaded as an example. You can then install it with the default options.rclone-v1.55.0-windows-amd64.zip
is downloaded as an example. Note that you only need to decompress it to any directory named in English (decompressing to a path containing Chinese characters might cause an error). In this example, the package is decompressed to the E:\AutoRclone
.Note:If GitHub cannot be opened or offers a low download speed, you can find another way for the download.
rclone --version
command to see whether Rclone is installed successfully.rclone config
command in Windows PowerShell.myCOS
) and then press Enter.env_auth>
is displayed, press Enter.access_key_id>
is displayed, enter the SecretId
of COS and then press Enter.
Note:Using sub-account permissions is recommended. You can go to Manage API Key to view your
SecretId
andSecretKey
.
secret_access_key>
is displayed, enter the SecretKey
of COS and then press Enter.cos.ap-guangzhou.myqcloud.com
) and then press Enter.private
or public-read
) as needed, which takes effect only for objects that are uploaded later. public-read
is used as an example herein. Therefore, you can press 2 and then press Enter.Default
is used as an example herein. Therefore, you can press 1 and then press Enter.Note:To use the INTELLIGENT TIERING or DEEP ARCHIVE storage class, please use the modifying the configuration file method and then set the value of
storage_class
toINTELLIGENT_TIERING
orDEEP_ARCHIVE
.
Edit advanced config? (y/n)
is displayed, press Enter.After performing the configuration above, the Rclone configuration file, vrclone.conf
, can be found in the C:\Users\Username\.config\rclone
directory. You can directly modify the file to update the Rclone configuration.
rclone mount myCOS:/ Y: --fuse-flag --VolumePrefix=\server\share --cache-dir E:\temp --vfs-cache-mode writes &
rclone mount myCOS:/ Y: --cache-dir E:\temp --vfs-cache-mode writes &
Note:
- If any error is reported during the process, you can view the error messages from Git Bash.
- If you delete a bucket from the drive, the bucket will be deleted, regardless of whether there are objects stored in the bucket or not.
- If you change the name of a bucket from the drive, the bucket name in COS will also be changed.
The mounted drive will disappear after the server is restarted. Therefore, you can perform the following operations to set the drive to auto-run at startup.
Create the startup_rclone.vbs
and startup_rclone.bat
files in the E:\AutoRclone
directory.
In startup_rclone.bat
, write the following mount command:
If COS is mounted as a shared drive on a LAN, run the following command:
rclone mount myCOS:/ Y: --fuse-flag --VolumePrefix=\server\share --cache-dir E:\temp --vfs-cache-mode writes &
If COS is mounted as a local drive, run the following command:
rclone mount myCOS:/ Y: --cache-dir E:\temp --vfs-cache-mode writes &
In startup_rclone.vbs
, write the following code:
CreateObject("WScript.Shell").Run "cmd /c E:\AutoRclone\startup_rclone.bat",0
Note:Please replace the path with the actual one.
Cut the startup_rclone.vbs
file to the %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
directory.
Restart the server.
Using a third-party tool to mount COS to a Windows server as local drive is also available. The following shows the mounting procedure using the TntDrive tool:
cos.ap-guangzhou.myqcloud.com
.SecretId
, which can be created/obtained at Manage API Key.SecretKey
Apakah halaman ini membantu?