Go utility program for day-to-day Mongo backups. Used by countgo.
- General idea:
- Execute
mongodump
command - Generated
.bson
file upload to S3 - Delete files older than 3 days from S3
- Execute
- Make config.yaml based on config-template.yaml
file_name
is the relative path of the.bson
documentcron_time
is the cron expression (eg.0 30 6 * * *
for 6:30 AM)
go build
./cron3 2>> log &
go test -test.v
mongorestore -d aracki -c visitors /path/file.bson
docker run --name mongo --rm -p 27017:27017 mongo:latest