File filters in Google Backup and Sync

backupfile-filtergoogle-drivesync

Google Backup and Sync provides continuous online backup of selected folders. However one key feature that I'm missing coming from another backup solution is the ability to set exclusion filters for folder/files. Is there an easy way to implement it?

As a developer, my machine constantly generates bin/obj folders all the time that are temporary and should not be backed up. Not only that it results in Google Sync regularly displaying an irritating "Remove warning", it also often locks those folders while uploading, so my IDE fails to subsequently build my code.

Best Answer

  • OK. So I got it working finally. Here is the method, step by step:

    1. Use FreeFileSync to create a clean copy of your drive at a different location. For example, if you want to backup your D:\ drive, you can create an empty folder on E:\ drive named D_Backup or something.
    2. FreeFileSync allows all kinds of exclusion filters (much like .gitignore) including wildcards and sub-folder matching. So exclude all of those unnecessary folders (bin, obj, packages, vendor, node_modules, debug, release) in the exclusion filters.

    enter image description here

    1. Use Mirror mode to make update process one-directional, since you don't want it to affect original source files (D:\ drive in our example). Use Permanent Deletion so that your Recycle Bin doesn't get filled.

    enter image description here

    1. Save this configuration as a Batch Configuration in FreeFileSync so that you could run it from command line. Turn on Run Minimized and Auto-Close options.

    2. Sync this folder with Google Backup and Sync.

    3. Using Windows Task Scheduler, create a task that runs daily (or whatever frequency you prefer) and runs FreeFileSync to update D_Backup. Google Backup and Sync constantly monitors that folder for changes and will start backup automatically. In the Action step, choose Run a program and choose C:\Program Files\FreeFileSync\RealTimeSync.exe (or where you installed FreeFilesSync). In the Add Arguments box, type the full path of the batch file that you save in step 4 above (surround path with double-quotes if it contains spaces). More information on this is available here.

    enter image description here

    My Google Drive that was near full is now at less than half way mark. As an added advantage, the Backup & Sync software doesn't keep my processor busy at all times, since the task runs only once a day, which I have set to run at lunch time.

    Hope this helps people down the road.

  • Related Question