Question

Snapshot w/o downtime

Posted October 23, 2013 10.7k views
I have a 1gb droplet. I have automatic backups. I'd like to run a snapshot (to save a particular clean state), but I don't want downtime (it's my only production server). One post says that for a 1gb server you don't need to shut down, but I get: Droplet is currently on. Please power it off to run this event. Is there another way? I could use rsnapshot, but can I do a full system restore from an rsnapshot image? (that would be better, because I could save it on my large NAS). Thanks!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
10 answers
@Pablo: You can schedule it by setting up a cronjob that takes a snapshot of a droplet via the API.
Never thought of that, thanks! By chance, do you (or anyone else, for that matter) happen to have such a script -- so I can share it on: DigitalOcean User Projects | GitHub?
Why not schedule the snapshot for 2:00 AM on Saturday (or some other time whenever traffic is low)?
Thanks pablo. I guess that would be ok, but it doesn't feel like the right thing to do (actually bring the production site down), and I figure there must be a way to do it live. I just need to find the way!
Don't you ever do any software upgrades and reboot your machine, anyways? That, too, would bring down your production site. I took a snapshot lastnight and it took a whopping 1 minute + 54 seconds -- not much of a sacrifice in exchange for the piece of mind that I can quickly spin up a new droplet should my production site ever become compromised (or, the more likely scenario, should I break something).

In the alternative, you could try an incremental, offsite backup w/either rsync or duplicity.
Unfortunately it's not possible to take a snapshot of a droplet while it's powered on.
@Kamal,

Is it possible to "schedule" a snapshot?
by Justin Ellingwood
Duplicity is a simple backup solution that can be used to backup data from a VPS instance to another VPS or a local machine. In this guide, we will demonstrate how to install duplicity on Ubuntu and configure it to perform automated backups.
Pablo, unfortunately I do not have such a script however it could just be a curl call to https://api.digitalocean.com with your API credentials.

You can’t create a snapshot without downtime or shutting off your droplet. The best you can do is like what @pablo said, schedule your snapshot when there are least traffic in your site.

Better yet, if you can afford, schedule a backup at your DO dashboard. Backups are pretty cheap anyway, $1 per month if you are running the 512MB droplet, or 10% of your droplet MSF.

Submit an Answer