Learn how to Upload Data Files to AWS S3 via CLI Tool | S3 Sync

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everyone and welcome to this lab session in this session you will learn how you can interact with your s3 buckets in your aws account with the help of the cli tool so over here you can see that we have two buckets as of now i will go back to the cli tool before you start with the cli tool just ensure that you have already configured your cli with your aws credentials so you do that with aws configure i have already done that so i will directly start from accessing the services in aws so whenever you start using the services within your aws account so you first need to write down aws so aws basically means that the cli will come to know that you are trying to access some aws service now the aws service that we are going to access is s3 so i have type down s3 and then the first command that we will be using is ls so ls basically means that it will list down all the buckets that you have in your aws account hit enter and here you can see that these are the two same buckets that we have inside our aws account now if you are interested in looking at what are the contents inside one of the buckets so for that you type down aws so as we are using the aws service then s3 then the same ls command and then after that you write down the bucket name with s3 colon and two backslashes then the bucket name i want to see my contents for is bucket dash skill curve hit enter so here you can see that as of now we have aws1.jpg file in this bucket if you also look for the other one so you do not get anything which means that this bucket is empty as of now all right so this is one of the folders created with the name aws dash s3 inside this folder you can see that we have these pdf files in jpeg folder we have these two images then we have a single image in this folder and another single image in this folder so i will copy this location what i will do is i will copy all of these files in my s3 bucket with the help of the cli tool so let's see how you can do that so i will just clean it out quickly in order to sync it so i have already copied the location for that we use the command aws so we are going to use aws and the services s3 and then we use the sync command whenever you want to upload a complete folder so as you know that we are going to upload this aws s3 complete folder to our to one of our buckets so for that you always use the sync command and then after that we give down we write down the location so this is our location from where we want to copy and then we give the location for the s3 bucket so this three bucket will be so this is the s3 bucket that we will be using to upload our content so that is bucket dash skill curve hit enter and now here you can see that all the files are now uploaded so now let us just look at the files that we have inside our bucket as of now so for that we will write aws s3 ls and then the name of the bucket so here you can see that these are the folders that we have inside our bucket and then if you want to see the contents inside that particular folder you can just write down the complete bucket name followed by a slash and then that particular folder name that you want to see so this is how you upload or sync the files now even if it again try to run this same command so as you know that nothing has changed in our folder so it will not run so you can see it do not give any output this is because there is nothing changed in our folder now if for any reason i just make a change in this so let me just add a text file over here so i have now added aws.txt file so now if i again go ahead and run this command so it will now only make the change to this one so you can see that it automatically syncs and then it only uploads the dot txt file that is that has been changed now if you go back to this so now you can see that we have all the contents inside this let us just refresh this page so these are all the contents that we have in here and if you go back to the bucket so aws bucket dash skill curve 1 is empty as of now so what we will do is we will go to the cli now from the cli we will go and copy the contents inside this bucket dash skill cup to this bucket in aws bucket dash skill cup1 so for that let's do this the good thing is first of all list down all the buckets so these are the two buckets that we have so for that we will use the sync command between the two buckets so for that write down aws s3 and now we will sync the two buckets so the first bucket where our content is has the name bucket dash skill cup and the second bucket where we want to sync all of the contents is aws bucket dash skill curve one hit enter okay just a typo over here so i will just go and change this name so now you can see that all of the contents has been now copied so we will go back and just have a look at it so first refresh this page and now you can see that all of the contents are available over here as well so this is how you use the cli tool to perform operations on your s3 buckets in the same way you can also perform other operations as well with this i hope you have got an understanding of how you can use the cli tool to interact with your s3 buckets in your aws account [Music]
Info
Channel: SkillCurb
Views: 31,692
Rating: undefined out of 5
Keywords: aws, amazon web services, s3, aws cloud, aws amazon, aws s3, aws cli, amazon s3, s3 bucket, aws s3 tutorial for beginners, aws s3 cli, s3 sync between buckets, s3 sync, aws cli commands
Id: sw150DahS2A
Channel Id: undefined
Length: 6min 35sec (395 seconds)
Published: Tue Apr 26 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.