![]() If you have a lot of files this could take a while on the first sync, but on subsequent copies, only changed files get transferred and it will be significantly faster. It is faster, keeps all of the file attributes intact, and will only waste time and network bandwidth on files that have changed. You could do this with the CP (copy) command. The next thing you need to do is copy your code to your Windows or NAS shared folder. Syncing your Raspberry Pi Code to Your PC However, remember that this means a password is stored in plain text for anyone to see if others have access to your Raspberry Pi. You can also put this command into a file called “mountme.sh” or whatever name you prefer, allowing you to run it quickly without typing it in every time. Sudo mount.cifs ///Dropbox /Dropbox/ -o user=yourusername,password=yourpassword Keep in mind you’ll need the username and password of your NAS or Windows PC to do this. To that you’ll need to run the following command. The next order of business is super simple! You’re ready to mount your NAS or Windows share to the newly created folder on your Raspberry Pi. Mount the Windows Folder on Your Raspberry Pi In my R2-D2 build, I created a folder in the root of my Pi called simply NAS and gave it full read write permissions. You’ll want to create a folder on your Raspberry Pi that will serve as the mount point for your network share. Sudo apt-get install samba samba-common-bin smbclient cifs-utils Installing Sambaīefore you can mount Samba (or SMB) shares on your Raspberry Pi you’re going to need to install the Samba client tools. Feel free to ask questions in the comments if you need help doing this in the GUI. Everything we do in this article is going to be command-line since the vast majority of people will be working with their Pi from the command-line. The first thing you’ll need to do is mount the shared folder on your Raspberry Pi. If you need help setting up a Windows 10 share, check out this article. However, a Windows 10 share will do in a pinch. I’d highly recommend using a dedicated NAS appliance for backing things up as they usually have superior redundancy and backup options for their own data. So let’s first go over how to backup your files to the network. I make a nightly copy of my development files and a weekly image of the SD Card. And you couldn’t be more right! I use both methods to backup my R2-D2 build project. Backing up a copy of the SD-Card to your PC (best)įor the astute in the room, you’re probably thinking right about now “Why not do both?”.Backing up your development over the network (good).In this how to backup a Raspberry Pi tutorial, we’re going to cover two main methods of backing up your Pi. You’ll have to remember what they all were and add them back one at a time. ![]() When you restore your code from a folder on your PC none of those configurations or libraries will be installed. You’ll also likely install new software libraries and packages onto the Pi for your code to take advantage of. When developing a projecting, you’ll likely need to make many configuration changes to the Raspbian operating system. ![]() However, may people fail to remember that a Raspberry Pi project isn’t just about the code they wrote. Honestly, for some projects it might be enough. Keeping a copy of your code on another device is absolutely a great thing to do. I know a lot of people will comment below saying things like “I keep a copy of my code on my PC/Dropbox/Smartphone.” and that’s awesome. Things to Consider Before Backing Up a Raspberry Pi That’s why backups are important and so in this tutorial we’re going to talk about how to backup a Raspberry Pi properly and some different ways to do it. Unfortunately, even with the protections offered in the Raspberry Pi for shorts and overloads, it is still very common for fry the device by wiring something incorrectly. It’s a super fantastic computer for these purposes and even includes a full set of GPIO pins for connecting all sorts of sensors, buttons, I2C serial communications, and other devices. A Raspberry Pi is a used a lot for prototyping and electronics learning projects. Many people pour hours and hours into developing a project on their Raspberry Pi and never put any though in how to back up their work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |