 Many times over the last two years of me making videos, I've said something along the lines of the most important thing you can do on your computer is ensure you have proper backups. Now, I'm not the most original person when I'm saying this because this is something that pretty much anyone who gives tech advice will say. This is something that is fairly obvious for most people and if you haven't ever been in a situation where you've lost data, then you're very lucky because the vast majority of people have been in a situation where they've either deleted something that they've not supposed to been deleted or something gets corrupted or something gets overwritten or they lose a hard drive or they have a fire or something like that or they're in a hurricane, you know, they lose data in some form or fashion and because they don't have proper backups, all that data is lost. The thing is, is that when I say that statement and sure you have proper backups, a lot of people wonder what that actually means. So what I'm going to do today is talk about a few best practices when it comes to backing up your computer. Now, some of these are going to be very common sense type of things. Some of them are going to be very technical, because I'm actually going to show you what I do when it comes to backing up my computer. So let me go ahead and jump right in. So the first thing that you need to do when you're working on developing a backup strategy is figure out what's important, because I'm going to tell you right now, especially if you're in the situation like I'm in where I have a ton of really large files. So a lot of them are videos that I've made for the channel. I also have a very large music collection. I also have a very large movie collection. And those files are, like I said, very, very large. They take a lot of space. So the first thing you really need to do is determine what is the most important stuff for you to back up, because I'm going to tell you right now, your movie collection is not important. OK, now, if you can find a way to back it up, that's great. But first and foremost, you should focus on the things that are the absolute most important to you, things like family photos, tax documents, personal documents, things like that, the stuff that you absolutely cannot afford to lose. That's the stuff that you should work on backing up first. Once you have that stuff backed up, if you can then figure out a way to afford or to develop a backup strategy for larger, less important files, then you can do those things. That's what I've done over the last year or so. I've focused on a way to back up the important stuff. And then I focused on a way of backing up the larger, less important stuff. The second part of developing a backup strategy is determining how many backups you want to keep. Now, the reason why I've put this so early in the backup process is simply because it does require you to kind of figure out how much backup storage that you actually need, whether that's on site or off site. So if you want to keep every backup that you have ever made, you're obviously going to need a lot more storage than if you just keep the last five backups and delete the rest. Now, I'm in a position where I can keep local backups pretty much indefinitely. So I keep multiple backups going all the way back to like 2015 or so. And those are all stored on an external hard drive. The most important stuff that I have, however, is backed up elsewhere and I only keep a couple backups of that because really I don't need any more than that. I just need to kind of create a delta changes backup strategy where I only back up changes between one backup and the other. So the third step on your road to backing up all of your stuff is going to be determining where you're going to be backing up. Now, the traditional advice that most people are going to give is to make sure you have backups both locally and somewhere off site. So probably the cloud or perhaps a friend's place or something like that. Now, the reason why this is important is because you can be the best person at backing up ever. But if you have all of your backups in the same place that you have your computer and your house burns down tragically or you're in a tornado or a hurricane or and you lose both the backups and your computer, your backup strategy doesn't really matter no matter how good it was. So the best solution for any type of backup, no matter how you do it, is to have one locally, one stored off site. Now, usually, again, that means the cloud. Now, the problem with backing up to the cloud is that it's expensive. Now, I know what everybody said. I can hear the data scientists and the people out there who deal with large amounts of data saying, Oh, data is cheap in the cloud for the vast majority of people who don't have tons of money backup is actually fairly expensive. Now, I'm not saying it's going to break the bank. You can find cheap hosting and cheap solutions online, but they're either limited or they're going to be slow. There's always going to be some kind of catch. So for me personally, the way I do it is I have backups locally on a couple of external hard drives and then all of the important stuff, so things like tax documents, things like all of my writings and stuff like that, all of my pictures and all that stuff is all uploaded to a service called P cloud. Now, P cloud is not open source. It is a alternative, I would say, probably to something like Dropbox. And it is fairly reasonable $100 for two terabytes per year. And it works fairly well. It obviously has a native Linux client, so it works really well on Linux. So I use P cloud to back up all of the most important stuff. So I have not only backups, all that stuff locally, but also off site. Now, that doesn't really take care of any of the larger files, things like all my videos, things like my movies or my music collection. I could upload probably all of my music to that two terabytes and still have plenty of room left. But I don't really want to upload that amount of data. It just simply doesn't really make all that much sense to me. So if for whatever reason I were to lose my music collection, it'd be fairly easy to get it back because I have it in multiple places. This third step that I'm talking about is the most important step. When you are thinking about how you're going to develop your backup strategy, you really do have to have a plan in place to ensure that you're backing up properly, both locally and somewhere else. That way, if you were to lose data and locally or on the cloud, you don't lose both. So if you learn nothing else from this video, make sure you learn this have backups both on site and off site. And like I said, you're going to hear about how cheap storage is pretty much all over the place. I don't personally think that I would consider a hundred dollars a year, even that cheap. Now, it is cheap when you can pair things like S three or something else like that, a hundred dollars a year is fairly cheap. However, I understand coming from a background where a hundred dollars is a lot of money. So the money that you put forward into your backup strategy, especially off site, can be a problem for some people who don't have a lot of disposable income. So if you can't afford off site backup, especially if you have a lot of data, you can develop a strategy where you backup only the bare essentials. So services like P cloud and Dropbox and Mega, all of these online storage solutions, they all have free tiers. So if you have just about like 15 or 20 gigabytes of stuff that you absolutely have to backup and you would be devastated if that stuff was gone, there's no problem with relying on the free tier. Just make sure you kind of keep track of where everything's at. So you can kind of cheat the system and almost all of them have the ability to gain more free storage if you do certain things, things like pulling more people or sign up for their social media accounts, whatever it happens to be. A lot of times you can move from the free amount of storage at the low tier right up to a good portion of good amount of storage. And for a lot of people, that's going to be enough to back up the bare essential, at least. OK, so the fourth step in your backup journey is going to be actually backing up. And this is where I'm going to show you actually what I do. So I have a rsync script that I've written and it's not going to be that useful for most people, simply because it's not all that complicated. Our sync is actually fairly easy. So before I move into how I do this, let me explain what our sync is. Our sync is a basic command line utility that allows you to basically take one directory and copy into another place. It's really all it is. It syncs one directory to another directory. That's all it does. Now, there are a literal ton of options when it comes to our sync and it can get very confusing. So I'm not going to cover all of them, basically, because I would be here all day long. However, I am going to show you the bare essentials. So let me show you what our sync looks like. So I'm going to open up a terminal. Now, our sync is run with just our sync command. Now, at the bottom level of all this, all it really does is it takes the directory you want to back up and then places it in another directory. So let's just say you have a external hard drive and then another directory. So obviously, this path does not exist. But you can get the idea of how this works. So basically it is running the our sync command on this directory. So let's just say it's the home directory and it's going to take everything that's in that directory and place it in this directory. Now, obviously, you want to make this second directory somewhere else. So an external hard drive, a thumb drive, our sync will also handle things like SSH and Samba. Both of those things will work. You just want to make sure that wherever that second directory is, it's somewhere else. That's the whole point of having a backup because you don't want to have it on the same hard drive that you have in your computer because it's probably going to be the one that fails if that's what's caused your data loss or something. You know, if you know what I mean. So that's the basic syntax. Now, like I said, if you were to man our sync, you would see that there's quite a bit here to it. And and I highly recommend you getting into the man page here and taking a look at all the stuff that you can do because it does go on for quite a while. There's a lot of stuff here. Obviously, there's a lot of options that you can choose. There's a lot of abbreviations that you can go on for. It just goes on for a long time, right? Now, most of the stuff you're never going to use, you're never going to need. Most of the stuff, I don't know what it does, but there are some things that you can use that are actually really good. So let me show you what those are. So this is my our sync script. And basically what this does is it just backups backs up my home directory to a directory on one of my external hard drives. Now, basically all you can ignore most of this stuff here. This is just setting some variables. But basically what this does is it runs our sync and then uses the flags AV. Now, a basically just tells our sync that you want to preserve everything, including permissions and stuff like that. And I almost certainly recommend you use the dash a flag. It's going to be the most common use of our sync for most people. You don't have to, but it basically just ensures that everything that you copy is preserved in such a way. Whereas if you were to transfer it back to a Linux file system, everything would still have the same permissions and the same owner and stuff like that. The dash V is called verbose. And basically that's just going to show the output of our sync as it runs. Now, the coolest flag that our sync has is the dash dash exclude flag. Now, the reason why this is so cool is because if you're like me, a lot of your big files are in your home directory. And if you're backing up your entire home directory and you have multiple backups that run like once a week, whatever, and you keep them all, that can balloon in size really, really fast. So there are certain directories in my home directory that I don't want backed up things like my music. I don't need a constant backup because that doesn't change all that much at all. So I'll back that up manually. Things like my ISOs folder. I do not need to back up every single ISO that I download off the internet. I have like 20 of them. A lot of them are multiple gigabytes. They just take up space. If I lose those, no big deal. Things like my steam folder. I do not need a backup of my games. And some of those are like hundreds of gigabytes. I don't need multiple backups of my games. If I lose that, I can always redownload them. So I always exclude my my steam folder, my dot cash folder. I exclude that because that thing can get really, really large and I don't need a backup of it. The dot var is another interesting one that houses a lot of data simply because I use flat pack a lot. And because that's true, especially seeing as how the steam flat pack is also in there, the dot var directory tends to get really big. So I don't back that up either. Now, the P cloud drive one is also one that I don't need to back up simply because that's also backed up online. That's P cloud. It's going to have everything saved in the cloud. So basically, all these excludes just take the files that I do not want backed up and excludes them from our sink as it runs. Now, this right here is just telling our sink the directory that I want to back up. So basically dash home is what I want to back up. And then this right here, basically what this is doing is it's going to tell our sink where to store the backup that it's creating. So in this case, it's using the variable B U D I R, which is this right here. And then it's going to create a new directory with the date. So in this case, it's going to use this variable right here. And that way, if I were to now CD into my slash Artemis and then backups and then 2022 and then Fedora, you'd see I have a ton of backups here. Every single one of these are ones that I've run. Now, I'm going to be talking about automation here in just a second. All of these are ones that I've run on my own. And that's going to be something that I'm very different about in terms of how I do backups than everybody else. And I wouldn't recommend doing it my way simply because I run every backup manually. So I I just I do our sink like so. The SH because I have it in my path and run that. And that's what our sync looks like when it runs. And it's going to basically back up everything that's in my home directory, including all my dot files, all my pictures, all that stuff. It's going to create a directory in my external hard drive for today with today's date and all the stuff is going to be there. So that's how I do backups with our sync. Now, there are other ways of backing up than just my way. So you could use something as simple as a CP command. So you could see the directory that you want to back up into another directory. You could do that. It's very easy. You could use a tool like Times Shift. Times Shift also uses our sync as an option. So that is a GUI front end for our sync. And it would allow you to do the same thing, but with a GUI front end. It's also good if you use Butterfest. So Times Shift will handle your Butterfest snapshots if you have them. Now, I'm not going to get into the Butterfest stuff here simply because it's too complicated, but in a future video, I plan on doing that. So make sure you're subscribed. So I highly recommend using our sync or front end for our sync. There is also another one called GR sync, which is basically a GNOME app. That is just a GUI front end for our sync. It's very simple, very easy to use. You simply put in the folder you want to back up the place you want to back it up to hit start and it runs. That's all it does. You don't have to worry about any of the flags that I just showed you. It obviously has those options, but if you don't want to mess around with any of the command line stuff, GR sync is a good one. Times Shift is a good one. And the command line really isn't that hard to learn. If you'd like a dedicated video for our sync, let me know in the comments section below. OK, so theoretically, at this point, you're done. You if you have handled an offsite backup and you've handled your R sync or local backup, you can go forth knowing that you at least have one backup to your name. And if the worst should happen, you have that data somewhere so you can get it back. However, there are a few more things that I should talk about. So the first one is restoring your backup. And this is going to be something that is going to be a long term problem for a lot of people, because a lot of people are very disorganized when it comes to their files. I'm one of those people. I try to be organized and I'm somewhat organized. But a lot of times I fall out of the habit of organizing my data and it's a big problem. So why this is important is if you are disorganized with your data and you want to restore from a backup, that disorganization comes with it. So the best thing you can do when planning for the eventual need to restore any data is to ensure that your data is always in its proper place. Create directories and make sure they're well named so that you know exactly where everything is and everything has its place. That way, if you were to lose something, it's easy to go find it on your backup and restore that. So if you just have stuff everywhere on your desktop, you're one of those people who just puts everything on the desktop. First of all, stop doing that. I'm judging you, but also it's going to make it much harder in the eventual need for you to restore something simply because your stuff's all over the place and you're not going to be able to find it. If you are organized with your data, it means that when or if you are in a situation where you need to restore from a backup, it's going to be simple just to copy and paste the directors from your backup back onto your computer so you can move your old pictures folder directly back into the pictures folder on your new install of Linux and move on. You don't have to go searching for pictures that are on your desktop, pictures in your downloads folder, pictures that are in your pictures folder, pictures that are randomly in your home directory for whatever reason, you know, put them all where they're supposed to go and you only have to copy that one folder instead of having to copy stuff from all over the place. Another tip that I can give you is use Git. So GitHub or GitLab are really good options for backup of certain things. So, for example, I have all of my dot files up on GitLab. That is multiple gigabytes of stuff that is stored somewhere else for free. And you never want to give up a place that stores stuff for free. Now, I also have all of my wallpapers up on GitLab, and that's like 10 gigabytes of stuff that's up there, backed up for free. If I were to lose all of my wallpapers, I could easily pull that wallpaper repo down onto my computer and have them all again. I'd never lose anything. So take advantage of Git. Now, obviously, Git's not going to let you back up everything because it's not unlimited storage, but you do have the option to store stuff up there that makes sense to. Now, one cautionary tale, be careful what you upload, obviously. And especially if you are going to have a public Git repo for your backups, I don't recommend having a public one. But if you, for whatever reason, have a public one for your dot files or whatever, don't transfer everything that you have in your home directory to the Git repo that you've created simply because you don't know everything that's in there. They're very well. It might be stuff in there that has personal information that you don't necessarily want to share. So be very explicit with what you upload to it. That way, you know precisely what you're sharing if you happen to have a public repo. Probably for most people, if you're going to use Git as a backup system for some things, just make sure everything's private. But even if you're using a private one, don't upload personal information up there. You never know if you get hacked or something like that. You don't want to lose stuff if that happens. And the last tip is that automation is your friend. And this is going to be the one tip that I don't follow. Like I said before, all of the backups that I do, I do manually simply because I want to know when the backup is running and what it's backing up. Because I sit here and actually look at the output of our sync as it's going. And I want to make sure that it's not doing anything weird. So personally, I run everything manually. However, most people are going to be really bad at that. So I've gotten into the habit of running my Arsync script alongside any any update that I do on my computer. So when I do my update command on Fedora, I also do an Arsync right with it. They both happen in a terminal side by side, and I've just gotten to that habit. Now, if that's something that you can do, getting into that habit, that's fine. If you are a person who has a hard time developing that habit, automation is your friend. So using things like Cron to schedule a Arsync event so that it does a Arsync in the background every day or every week, whatever happens to be schedule a Cron. I have a video on how to use Cron. I'll try to link that in the video description. It's very, very easy and it allows you to create a backup that runs on a schedule. And it means that you can kind of set it and forget it. You never have to worry about whether or not you have a backup. Now, obviously, when you set something to automate, it means that you're going to have backups accumulating over time. And that can severely impact your storage. So if you only have like a couple terabytes or a couple hundred gigabytes of storage, the more backups you have, the less space you're going to have. So you'll want to kind of make sure you perform some maintenance on it and keep in tune with how much storage you actually have. So if it just keeps running perpetually, eventually you're going to run a storage and then you're just not going to have anything else there. So kind of prepare for that eventuality and make sure you're aware of everything that's going on, even if you have automation in place. So those are my tips for how to successfully back up your computer. There's obviously more stuff in depth that I could have gone into here. Things like how to use Time Shift. I'm going to do a Butterfest video eventually. I know I've been promising that for like six months. It is going to happen eventually, I promise. I'm working on it. I'm slowly inching towards actually recording that video. I could have also gone into our sink much more in depth. And maybe I will in a video if more people are interested in that. So if you have comments on this kind of stuff, leave those comments in the comment section below. I'd love to hear from you. You can follow me on Twitter, Athleanxcast. You can follow me on Massive on Odyssey. Those links will be in the video description. You can support me on Patreon at patreon.com slash linuxcast, just like all of these fine people. Thanks to everybody who does support me on Patreon and YouTube. You guys are all absolutely amazing. I'm so grateful for all of your support. So thank you so very much for that. Thanks everybody for watching. I'll see you next time.