Timmiej93
Posts: 17
Joined: Tue May 26, 2015 6:22 pm
Location: The Netherlands

What's the best way to backup everything?

Wed Jan 17, 2018 6:42 pm

I've been playing with my RPi for about 3 to 4 years now. In that time, 2 SD cards have stopped working, forcing me to redo everything I had set up. I've always had the habit to make backups while I'm setting stuff up, but that habit hasn't completely trickled in yet when making small adjustments. So over 2 years, all those small changes make for a lot of work to redo (and remember how to redo) when a card fails.

The way I currently make my backups:
Shutdown the Pi, take the SD card out, put it in a PC and create a disk image with Win32 Disk Imager. While it works fine, it's far from automated, and far from convenient. So is there's any other, better way to make these backups of the entire system, or is this the best way to do it?

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: What's the best way to backup everything?

Wed Jan 17, 2018 7:02 pm

Some people have reported success with the SD Card Copier tool that is installed by default with recent versions of the Raspbian Operating System.

Timmiej93
Posts: 17
Joined: Tue May 26, 2015 6:22 pm
Location: The Netherlands

Re: What's the best way to backup everything?

Wed Jan 17, 2018 7:15 pm

A quick google search told me that this only works in the GUI (doesn't seem very handy for automating?), and it requires an external SD card reader + SD card, which I don't have. I'd prefer to upload the copy to Dropbox, or an other cloud service, from which I can then manage the backups.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: What's the best way to backup everything?

Wed Jan 17, 2018 7:19 pm

OK. You asked for any other way. I suggested one, not knowing of your constraints.

Timmiej93
Posts: 17
Joined: Tue May 26, 2015 6:22 pm
Location: The Netherlands

Re: What's the best way to backup everything?

Wed Jan 17, 2018 7:23 pm

That is very true, and I do appreciate your answer. I did forget to mention these preferences in the original post. I'm still interested in any other way, since it might come in handy some day.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5618
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: What's the best way to backup everything?

Wed Jan 17, 2018 7:47 pm

Timmiej93 wrote: A quick google search told me that this only works in the GUI (doesn't seem very handy for automating?), and it requires an external SD card reader + SD card, which I don't have. I'd prefer to upload the copy to Dropbox, or an other cloud service, from which I can then manage the backups.
Whilst it's probably still not what you prefer, IIRC, you may be able to use a similar sized USB flash drive instead (but, of course, recovering the backup from that would require said drive to be plugged into another computer, which could be a "local" pi, to write the backed-up image to a uSDHC card as, also would your "cloud service" etc.).
USB external card readers/writers historically have been more reliable for writing your own O.S. images, since not all "built-in" card slots have proven to be fully SDHC compatible. You don't indicate where you are but, here in the U.K., even the ones sold in our "poundstores" ie. cost £1 have often been good enough. FWIW, here's a link to those devices I've used from time-to-time (some acquired before my first Pi, some supplied with SDHC or uSDHC cards, and some at "poundstore" equivalent prices:
http://www.cpmspectrepi.uk/raspberry_pi ... aders.html )
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

wh7qq
Posts: 1448
Joined: Thu Oct 09, 2014 2:50 am

Re: What's the best way to backup everything?

Thu Jan 18, 2018 12:40 am

Unless your RPi is totally static and you neither read from it, write to it or update it, having rare backups made of the entire uSD are time consuming and then when you need them, potentially outdated. Occasionally having to redo everything has the additional benefit of your more recent thinking on how best to do stuff and and the updates, bug fixes and security updates that the Foundation provides.

If that is too time consuming for you, you might do well to investigate "rsync" further and automate it in a cron job so it runs during your down time and as it only saves things that have changed, it takes less time and is much more current. If rsync's complex set of options and syntax is too hairy, Grsync is in the Raspbian repository and can be added. There are lots of online tutorials for using it.

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: What's the best way to backup everything?

Thu Jan 18, 2018 6:36 am

I use good ol' tar every Sunday morning. I exclude files/directories I don't *need*. It takes time, how long depends how much is being backed up. Using a tarball means I can restore a working system, a whole directory or a single file if needed. It has worked for me others may not like it. The biggie is to test the restore process to be sure that works...:-)
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

Timmiej93
Posts: 17
Joined: Tue May 26, 2015 6:22 pm
Location: The Netherlands

Re: What's the best way to backup everything?

Thu Jan 18, 2018 1:49 pm

Thank you for all your suggestions. I tried rsync, but it was indeed a bit confusing, especially since I'm quite busy at the moment, so I don't have a lot of time to read up (usually this is the reason why I don't have backups setup, I never have the time to do the research and set something up).

I've now got rsnapshot working. It saves the backups on an external USB flash drive I had laying around, zips them and uploads them to my Dropbox. The only thing I'm worried about, is if I've got everything. While rsnapshot was easier to setup, it was still confusing. I stuck with the default setup of backing up /etc, /home and /usr. I haven't done a whole lot with my RPi outside of those folders I think (Pi-hole and Domoticz mainly), so I think this should be enough? It would be lovely if you guys could give your thoughts on what should be backed up.

wh7qq
Posts: 1448
Joined: Thu Oct 09, 2014 2:50 am

Re: What's the best way to backup everything?

Thu Jan 18, 2018 8:46 pm

I've now got rsnapshot working
Reasonable choice...as with most, based on rsync under the hood.

Return to “Beginners”