How to take backup of digital ocean droplet in dropbox or offline disk_?

(Gaitonde) #1

How do we take backup of full DO droplet in dropbox or any other offline disk?
I want to backup my DB everyday night in dropbox or other file.



Won’t that be overly stupid and useless? .

You can set up a cron job to rsync all data to your PC though.

My recommendation would be to try this:
Set a cron job to create a dump of your database in a specific folder every x hours.

Use a tool like S3CMD and configure it so that wherever the local folder is changed it syncs it with the remote bucket: either on DO or on AWS or minio


How is storing database dump only good for syncing not for backup?


Not really, If your dumping script is creating a unique filename for every dump by appending the backup date/time then it will sync all of those backups.

You however will have to add additional cron job to delete files created 30 days ago separately.


I definitely can share a nuked version of the python script I use. We basically have written a script which is triggered at 12:00 in night and noon and dumps the database (mariadb and postgresql) into the following format: [dbname-backup-date-time.dump] and then stores it into /var/custom/backup folder and then S3CMD is configured in a way that a python script scans changes to the directory every 5 minutes then uses S3CMD to send all the changed files to our Digitalocean Spaces bucket.
This is so far working just fine for us. But due to the experimental nature of the script and all the tokens being hard coded, I can’t share it as is. I’ll make it available on my github whenever I get time.


All the best!

(Gaitonde) #14

No, on Postgres


Process for dumping database is same for postgres as well, you just need to change the command.


There is no reason for this command to not to work.


Give it a shot