Smart backup: how to arrange everything quickly and efficiently

Data backup should be performed automatically, quickly and without any omissions. All this is able to implement the solution described in our guide, efficiently using disk space.

At least once in your life you have experienced this nightmare: one careless click - and a vital file has already been rewritten. The damage from such a disaster can be leveled thanks to regular archiving. We provide you with a solution, works with open source utilities. At the first stage, we will set up automatic copying of photos and videos from the phone to the PC. The second stage is automatic and regular archiving of snapshots of computer folders.

Backup starts automatically in the background and takes several minutes. To implement it, use the rSnapshot package, a Linux script, working in Windows. First, we will describe this program in detail using the example of a PC with a built-in second disk as storage. In the next step we will explain, what to consider when working with a laptop and a temporarily connected external disk. At the end of the article you will find the most convenient options for archiving using NAS systems, offering an extremely similar solution, but with a simplified configuration.

Archiving data from a smartphone

Increasingly, photos and videos are being created using a mobile phone, after all, he is always at hand. However, manual backup of the phone requires too much fuss. Developers’ Cloud Solutions, of course, make the job easier, however, in terms of privacy and security, they are not always reliable. And yet, with a little effort, you will be able to implement your own solution for automatic folder synchronization between an Android device and a desktop computer. 

Syncthing setup on Smartphone and PC

  • Install theSyncthing app on your phone
  • Now from the page download the client for Windows.
  • Unpack the archive on your computer and run the filesyncthing.exe .
  • The command prompt opens, and after it - a browser with a web interface. Here click on Actions Show ID, to see the QR code of the computer.
  • In the app on your phone, go to the tabDevices, click on the iconin the upper right corner, and then next to the linedevice ID- click on the QR icon.
  • If there is no QR code scanner on your phone, install Barcode Scanner utility via Play Market.
  • Now read the code from the computer screen, set Nameand click on the check mark next to the entryAdd a device.
  • After about a minute, a window with a question will pop up in the web interface, do you want to connect your device to your computer. Make sure, that the ID matches the code of your smartphone, and confirm the action.
  • To specify folders on the phone to sync, go to theFolders tabin the app, and by clicking on the icon add the necessary directories. Activate the switch under the device, with which you want to sync the folder (for now it’s just your PC), and the switchProhibit changes, to save images and videos on your phone.
  • After some time on the computer you will be asked, whether to sync this folder. Answer the question in the affirmative and specify the destination folder - the best one, which will then undergo the archiving described below.

You can also add other folders to exchange data between your phone and PC. From now on, the folders will be constantly synchronized, whileSyncthingSettings, where in the sectionExecution conditionsactivate the optionsBackground modeandWIFI-only synchronization.

In this case, the files will be synchronized over the Internet in encrypted form, even if you use someone else’s wireless network. However, you can restrict synchronization.

  • To automatically start Syncthing on your computer, press theWin R keysand entershell:startup.
  • Drag and drop the filesyncthing.exe to the folder that opens and select ‘Create shortcuts’
  • Then in the shortcut properties in the line Windowselect the optionCollapsed into an icon.
  • Now in the web interface from the sectionActions Settingsuncheck the box next to the entryLaunch browserAccess to the web interface when the program is running will now be carried out via the URLhttp://localhost:8384

Archiving ’snapshots’ on a PC

rSnapshotcygwinC:cygwin, it should be opened with the editorNotepad

  • Use Notepad to open the fileC:cygwinusrlocaletcrsnapshot.confYou will see a standard Linux configuration file with detailed comments. First decide on the destination folder: it should be empty, located on another disk and formatted for NTFS, where the source files do not lie.
  • Line number23rsnapshot.confyou will find the parametersnapshot_root, after that, just once (this is important!) click on theTab

Conversion and specifying access paths

Each path must be entered according to the requirements ofCygwin/cygdrive/, the colon is missing. A slash is used for separation, and the path ends with the sign/Thus, from the pathC:rsync-backups it turns out/cygdrive/c/rsync-backups/The conversion instructions can be found in the folderc:cygwinin the script-PathConverter.cmd.

  • In the Explorer window, navigate to the appropriate destination folder, click on an empty section in the Explorer address bar and copy the path.
  • Paste this path into the converter’s command prompt window. Now the path is shown in accordance with the requirements of Cygwin and simultaneously copied to the Windows clipboard, so that you can transfer it to the rsnapshot.conf fileusing the Notepad editor.

Folders, from which snapshots will be taken, you specify in the section’BACKUP POINTSfilersnapshot.conf, starting from the line number222backup, tab step, then the source folder as a Cygwin path, don’t forget to put the / symbol at the end, tab step andlocalhost/(as a subfolder in the destination folder).

An example for two folders looks like this

backup /cygdrive/c/Users/_Tester/Pictures/ localhost/
backup /cygdrive/c/Users/_Tester/Documents/ localhost/

The default samples from rSnapshot are disabled by writing the # sign in front of them

Setting up automatic archiving

We recommend you the following rhythm of creating backups: a snapshot when logging into Windows, and then a snapshot every hour. Of these hourly copies, only the last six will be stored. Of the last seven days, the latest snapshots are also saved, as well as the last four weeks and the last six months. Thanks to this, copies for long periods will be clearly available to you. In the Windows Task Scheduler, the configuration is very simple, since rSnapshot already provides default settings for such archiving.

  • RunTask Schedulervia the menuStartWindows and underActionclick onCreate a task.
  • To create backups of your data once an hour, specify the following: on theGeneral tabas the name, for example,rsnap hour.
  • On the tab’Triggersclick on Create, selectStart a task: when logging into Windows, check the box to recordRepeat the task every: 1 h.and click onOK.
  • On the tab’Actionsclick Create, select for the optionProgram or scriptthe script you prepared in advancec:cygwinrsnap_hour.cmdand click onOK.
  • To create daily ’snapshots’, repeat the procedure, only now setrsnap day as the name.
  • As a Triggerselect the optionAccording to the schedule Dailyand specify the time at the end of the day, when the computer is most often still on. For this and the next task, do not activate the repeat function.
  • On the tab’Actionsselect the scriptc:cygwinrsnap_day.cmd.
  • Do the same with weekly and monthly snapshots - choosing scripts with the appropriate names and trigger settingsWeekly’‘Monthly

rSnapshot optimization for laptops and external drives

If you plan to save snapshots to an external disk, two factors should be taken into account: the destination disk should always correspond to the same logical drive letter, and the snapshot script should only work when the target disk is connected.

  • To comply with the conditions of the first paragraph, when the disk is connected, call the utilityDisk management.
  • Right-click on the media here, and then - by Change the drive letter or drive pathand select a letter from the middle of the alphabet.
  • To ensure that, that a full backup will not be performed, while the disk is not connected, open the rSnapshot filersnapshot.conf and then in the line number29#before the parameter’no_create_root 1, which stands at the very beginning of the line.

After that, the archiving tasks will be performed once an hour as before, but the script will be interrupted immediately, if the destination folder is not detected. After connecting the disk with the target directory, the backup will continue in normal mode.

NAS: comfortable archiving

NAS drives are universal devices for storing information. They, as a rule, they already contain a solution for creating snapshots of the system, the principle of operation is similar to rSnapshot. To make archiving easy, network storage should offer two separate volumes. Unlike the default configuration (according to which two hard drives are combined into one RAID 1 mirror array), you will have to format each disk as a volume in the NAS Storage Manager.

If you have already configured RAID 1 or purchased NAS storage, you can connect a USB drive as a second volume. The first disk, that is RAID 1, in this case, you use the NAS as the target folder for synchronization software from the developer.

The second volume is a snapshot storage location, performed during the archiving process. Qnap offers a solution, similar rSnapshot, referred to asHybrid Backup Sinc, which you will find in the App Center (at Synology:Time Backup, also requires additional installation).

  • In the Qnap utility, click on‘Create Job Backup Local Backup’.
  • As ‘Source Location’select a directory, where the files are located, which should be copied.
  • ForBackup Destinationspecify the folder on the second volume.
  • In the Advanced Settings sectionset a schedule for archiving every hour.
  • Now check the box for the optionEnable multi-version backup.
  • In the next window, selectSmart versioningThis way you can adjust the exact intervals for the pictures.

It doesn’t matter, how did you configure saving snapshots: manually on a PC or via the web interface of the network storage. The advantages of these methods are the same: after a single setup, everything works automatically. And now there is no point in fearing deletion, overwriting or loss of a file - you are very likely to find a copy of it in the snapshot archives.

Read also

  • Remote access to the computer from mobile devices
  • How to control a computer remotely and quickly solve any problems