Obviously having a good antivirus program should help to protect you, and not opening emails from someone you don't know is equally important, but the only foolproof answer is to do regular backups, on a removable hard drive, USB stick, or DVDs, and to keep the backup device disconnected from the PC at all times except when actively doing a backup. Also, only perform a backup immediately after running an antivirus scan if that is possible.
Doing a backup is one thing we all tend to put off doing, possibly because it seems a lot of fuss and bother, but using the right software can make it very easy. SyncBack Free is a very useful, free, backup program, which helps you to back up important information, photos, videos and other data, onto an external or internal hard drive, though to avoid ransomware only an external drive will be of any use, and after the initial set-up, which can be a bit daunting if you don't know what you're doing, it's plain sailing. There are other programs that do the same job, and no doubt the principles of using them will be fairly similar, but I will deal with SyncBack Free, because that's what I'm familiar with.
For those who have never used SyncBack Free, or any similar program, hopefully this short 'How To' will make setting it up a lot easier. Experienced users will probably not learn much they didn't already know, but I will make it as simple as possible, for those that need to start from scratch.
The first thing to learn, after downloading and installing the program, is the simple concept of Source and Destination folders. The Source folder is the folder where the files you want to backup are stored, and the Destination folder is the folder on the external drive (usually) where you want to store the backup copy. That is probably very obvious, I know, but if you don't grasp that idea, you won't understand the rest.
So, to start, open the program. Also open the Source folder where where the files to be backed up are, which in this explanation will be My Documents. Then plug in your USB hard drive, open it, and browse to the area where data can be stored, and to make things simple I will assume it is a new drive, with nothing stored on it. That will be where the Destination files will go.
You should now see something like this. Top left is the Source folder, top right is the Destination folder, and at the bottom is the program box. It's not essential to have the Source and Destination folders open, but it will make it much easier to understand what is happening.
I have set up an Old Time Radio folder, which we will assume needs to be backed up in full, and My Documents, which contains some folders which don't need to be backed up. I'll start with the Old Time Radio first, because that is the simplest.
In the SyncBack box, click the Profiles button, and select New. A box will open as shown below.
Type in a meaningful name for the new profile, so you know exactly which folder it refers to, in case you need to set up a lot of profiles, which could lead to confusion. I have used Old Time Radio, which should be obvious if I need to change anything in the future.
Click Next, then in the next box that opens, check that Backup is selected, and press Done. After a second or two the following box will appear.
Click the small folder icon to the right of the Source button, not the button itself, and browse until you find a folder that needs to be entirely copied, in my example, Old Time Radio. Highlight it, and click Select Folder.
Now click the folder icon for the Destination folder, and browse to your USB hard drive. At this point you can create a new folder, which in my case will again be Old Time Radio, or simply type the new folder name at the end of the folder filepath that has appeared due to your browsing. That will automatically create the necessary folder on the external hard drive.
When the Source and Destination folders have been set, as in the image above, click Apply, then OK.
You should now have a Profile in the SyncBack box, and can test it by doing your first backup. Click the Task button, and select Run. Eventually you will use Run Unattended, but for now just use Run, so you can see what is happening.
After a while you should see a box similar to that shown above, and you can just click Continue Run. When using Run Unattended that will not be necessary.
After the backup has completed, SyncBack should show that the backup has been successful. If it doesn't, highlight the new profile, click the Profile button, and select Modify. That will allow you to set the Source and Destination folders again, and retry the Run.
If the Run was successful, and you have the external drive folder open, you should be able to check that the files were copied over, and if so, that's the first Profile done. Congratulations.
To backup a folder where some folders need to be ignored is almost exactly the same, and follows the same pattern.
In the next example, My Documents contains the Downloads folder, which, for the sake of the example, I'm assuming doesn't need to be backed up.
Start a new Profile, type in My Documents (for example), and when you get to the box shown above, set up the Source and Destination folders, adding My Computer to the end of the filepath, as shown. Then, before pressing Apply, click Choose sub-directories and files.
In the new box, deselect any folders or files that don't need to be backed up, and press OK. Click Task, Run to test your new Profile. As before, in case of a problem, highlight the Profile, click Profiles, Modify, and check your settings.
Assuming all has worked OK, you can create as many Profiles as you need, or carry on with what you have done so far. Extra Profiles can be added at any time.
The final piece of the jigsaw puzzle is to connect all your Profiles, so you only need to Run one Profile.
Start another new Profile, and call it Backup All, or something similar, then tick the box that says 'This is a group profile', and click Done.
In the next box, click the double arrow icon to move all Profiles to the right hand box, which means they are part of the group Profile, or double click individual Profiles to move them if you only want some to run in the new group Profile. You can remove them in the same way. Click Apply, then OK, and your new group Profile should appear in SyncBack.
Highlight the new Profile, as shown above, and click Task, Run unattended.
If all has been set up properly, you should get no errors, and you have learnt how to set up and use SyncBack. Extra Profiles can be added easily, once you have grasped the basics. You might make the odd mistake to begin with, and I still do sometimes, but if so, just go back and check your settings, or read the advice again, and you should be OK. Profiles can be added to or removed from a group Profile using Profile, Modify.
When you have finished backing up, click the Safely Remove Hardware and Eject Media button, usually found in the bottom right corner of your screen, near the clock, and when notified that it's safe to remove the hard drive, disconnect it, and leave it disconnected until it's time for the next backup.
Unless you have added a lot of new files to your folders, the next backup should take much less time to do than the first, as only any files that have been added or modified will be backed up.
I have just bought a second external hard drive, and I will backup all my important folders on them alternately, to ensure I should always have two fairly up to date backups.
I might even do it weekly !