pankeshpatel / mDiabetes

This is mDiabetes repository
1 stars 2 forks source link

Write a cron job that take .csv file of MongoDB and put it into S3 bucket every day #32

Open pankeshpatel opened 2 years ago

pankeshpatel commented 2 years ago

I have figured out how one can export .csv file from our docker MongoDB. We now just need to write a script that can take these .csv files and put them to a S3 bucket (public folder), so our end-users can access the files.

sudo docker exec -i 994c6241ae5a mongoexport --username root --password 123456 --authenticationDatabase=admin
 --db md-server-db --collection foodlogs --type=csv --fields "patientID","mealType","carbs","timestamp"  > foodlogs.csv