Last year while I was working in a project, I needed to automate the whole backing up process from taking snapshot of the current db to saving it to AWS S3 buckets. At that time I took most of the staffs from this blog post.
Couple of days ago, I started to code for making small backup script that will backup to another cloud machine rather than to AWS S3. Instead of coding it from scratch, I reused my previously coded script. All I need to implement a bash function(save_in_cloud) which runs a simple scp command
The whole script look like below: