One day while traversing through the directories and realizing that folders/files that are not accessed on a day-to-day basis are taking up space on the NVMe SSD and decides that they are uploaded to S3 compatible cold object storage so that it is safe and secure and can be accessed whenever and wherever but do not waste the puny SSD space. đ
Scaleway
1 has some really nice storage options:
You get 75GB free storage and external outgoing transfer on both Object Storage and C14 Cold Storage every month! For Object Storageâs Standard Class, the price charged after 75GB is âŹ0.01/GB per month per volume stored, and âŹ0.01/GB per volume transferred. In addition, transfer to and from other Scaleway products in the same region is completely free! You also donât have any fees per API or console request.
Okay, letâs do it!
- Install minio:
1
$ wget https://dl.minio.io/client/mc/release/linux-amd64/mc -P /usr/bin/ && chmod +x /usr/bin/mc
- Configure minio
1
$ vim ~/.mc/config.json
append the folloing to the config.json
file:
1
2
3
4
5
6
7
âs3â: {
âurlâ: âhttps://s3.fr-par.scw.cloudâ,
âaccessKeyâ: âkey-hereâ,
âsecretKeyâ: âxxxx-x-xx-x-x-x-x-x â x-x-â,
âapiâ: âS3v4â,
âpathâ: âautoâ
}
Tadaa!!!
Upload a file folder directly from the command line as follows:
1
$ mc cp â recursive âdirectory with spaces/â s3/bucket/
Or, why not integrate it into the Linux Mintâs context menuâŠ?!
âŠlike this:
Let us check the Linux Mint Nemo source
to find out how.
1
2
3
4
5
6
7
8
9
[Nemo Action]
Active=true
Name=Upload to S3
Comment=Upload to Object Storage
Exec=/usr/bin/python3 /home/<username>/s3.py %F
Selection=any
Terminal=true
Extensions=any;
EscapeSpaces=true
Create the target s3.py file:
1
2
3
4
5
6
7
8
9
10
import os
import sys
if __name_ == ' _main__':
for index, arg in enumerate(sys.argv):
if index != 0:
print (arg)
if os. path.isdir (arg):
os.system (f'mc cp --recursive "{arg}" s3/bucket/HomePC')
else:
os.system (f'mc cp "{arg}" s3/bucket/HomePC')
Voila!