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.

@anon71964425


#2

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


#5

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


#7

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.


#9

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.


#11

All the best!


(Gaitonde) #14

No, on Postgres


#15

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


#17

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


#19

Probably!
Give it a shot