|
|
|
|
|
by drinchev
3544 days ago
|
|
Yep. Here is an example that I use to upload it to dropbox. I don't delete and/or gzip my oldest uploads though. #!/bin/sh
DATE=$(date +%d-%m-%Y@%H:%M:%S.%3N)
DB_USER="qux"
DB_PASS="foo"
DB_NAME="bar"
DROPBOX_TOKEN="baz"
/usr/bin/mysqldump -u${DB_USER} -p${DB_PASS} ${DB_NAME} > /tmp/${DATE}.sql
/usr/bin/curl -H "Authorization: Bearer ${DROPBOX_TOKEN}" https://api-content.dropbox.com/1/files_put/backup/ -T /tmp/${DATE}.sql
|
|
One alternative is to put these backups into S3 using pre-signed requests rather than Dropbox. An S3 pre-signed request gives permission only to upload files, perhaps only to a certain location in a certain bucket.
It's a bit harder to set up, but the shell script will look almost the same.