5

Backup DigitalOcean droplet locally

 1 year ago
source link: https://gist.github.com/amalmurali47/c58ef024683cccd242625995b45b7b72
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Backup DigitalOcean droplet locally · GitHub

Instantly share code, notes, and snippets.

Backup DigitalOcean droplet locally

DigitalOcean does not provide a way to download a snapshot of your droplet locally. You can use rsync to accomplish this instead.

On your local machine, assuming you have added your-server in your SSH config:

rsync -aAXHv --append-verify --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} your-server:/
  • -a : archive mode (all files, with permissions, etc.)
  • -A : preserve ACLs/permissions (not included with -a)
  • -X : preserve extended attributes (not included with -a)
  • -H : preserve hard links (not included with -a)
  • -v : verbose, mention files
  • --append-verify: if the files differ in modification or other timestamps, it will overwrite the target with the source without scrutinizing those files further

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK